OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
php-general-digest-help_at_lists.php.net
Date: Tue Jan 14 2003 - 19:38:55 CST

  • Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

    php-general Digest 15 Jan 2003 01:38:55 -0000 Issue 1823

    Topics (messages 131544 through 131641):

    Re: Amount of data in the database
            131544 by: Denis L. Menezes
            131548 by: Lars Olsson

    mail client?
            131545 by: Henning Olsen
            131559 by: Steven Balthazor
            131562 by: Jason Wong
            131563 by: Joshua Pierre

    Re: Persistent global data ?
            131546 by: Rick Emery
            131547 by: Mathias Rockel
            131554 by: Rick Emery
            131556 by: Mathias Rockel
            131557 by: Mathias Rockel
            131579 by: Philip Hallstrom
            131583 by: Mathias Rockel
            131584 by: Tamas Arpad

    PHP locks up in WIndows - Help!
            131549 by: Bil Click

    Going from 1040601600 to Human time
            131550 by: Davíð Örn Jóhannsson
            131552 by: Chris Boget
            131553 by: Jason Wong
            131558 by: Chris Boget
            131564 by: Jason Wong

    data move, Please Help..
            131551 by: Edward Peloke
            131555 by: Rick Emery
            131561 by: Edward Peloke
            131608 by: Edward Peloke
            131613 by: TomH
            131622 by: Edward Peloke
            131625 by: Tom Rogers
            131627 by: Peter Janett

    Re: permission denied
            131560 by: Anthony Ritter

    Re: globals off in function
            131565 by: Michael Bevz
            131601 by: Foong

    Re: HTTP_ACCEPT - Reliabilty?
            131566 by: Chris Shiflett

    Re: Cookie, header, output problems
            131567 by: Chris Shiflett
            131621 by: Vahan Yerkanian

    Re: session_destroy problem
            131568 by: Tamas Arpad
            131569 by: Scott Fletcher
            131576 by: Larry Brown

    Data type issues
            131570 by: Peter Hutnick
            131572 by: Bastian Vogt
            131592 by: Ford, Mike [LSS]

    Oracle and CLOBs
            131571 by: Jadiel Flores

    Re: include_files message question
            131573 by: Jesse Cablek

    Parse error
            131574 by: Brent Lee
            131575 by: Joseph W. Goff
            131580 by: M.A.Bond
            131581 by: Brent Lee

    norteh explode
            131577 by: Clivus2k1.aol.com

    PostgreSQL Cursor ROWCOUNT
            131578 by: typea.l-i-e.com

    valid MySQL result resource
            131582 by: Brent Lee
            131586 by: Jason Wong
            131599 by: Foong

    Dumping Tables from MySQL
            131585 by: Don Mc Nair
            131587 by: Jason Wong
            131588 by: Chris Hayes

    htmlspecialchars
            131589 by: Foong
            131594 by: Chris Shiflett
            131595 by: Jason Wong
            131603 by: Foong
            131619 by: John W. Holmes
            131632 by: Justin French

    PHP and Oracle
            131590 by: Jadiel Flores

    query question
            131591 by: Kelly Meeks
            131593 by: Jason Wong
            131598 by: Foong

    --without-mysl in configure command
            131596 by: gamin
            131597 by: Johannes Schlueter
            131602 by: gamin
            131604 by: Johannes Schlueter
            131605 by: gamin

    PHP receiving e-mail
            131600 by: David Russell
            131618 by: Philip Hallstrom

    Re: portabily including files
            131606 by: Jesse Cablek

    Authentication programming
            131607 by: Jordan Elver
            131609 by: Stephen
            131629 by: Justin French

    Windows vs Linux
            131610 by: Beauford.2002
            131614 by: Beauford.2002

    emptying hte array??
            131611 by: Scott Fletcher
            131612 by: Scott Fletcher
            131631 by: Justin French

    Why is my URL encoding itself?
            131615 by: Don
            131616 by: Chris Shiflett
            131617 by: Don

    MySQL problem with RedHat 8
            131620 by: Daniel Elenius
            131623 by: Joseph W. Goff
            131624 by: Daniel Elenius

    Re: occasional mcrypt problems
            131626 by: J Smith

    Next and Previous
            131628 by: Miguel Brás
            131630 by: Chris Shiflett
            131634 by: Miguel Brás
            131638 by: Timothy Hitchens \(HiTCHO\)
            131640 by: Miguel Brás

    PHP & RTF
            131633 by: [-^-!-%-
            131641 by: Michael Hall

    attach image with the mail command?
            131635 by: harald.mohring.gmx.de
            131639 by: Timothy Hitchens \(HiTCHO\)

    <a href> question
            131636 by: Ezequiel Sapoznik
            131637 by: Timothy Hitchens \(HiTCHO\)

    Administrivia:

    To subscribe to the digest, e-mail:
            php-general-digest-subscribelists.php.net

    To unsubscribe from the digest, e-mail:
            php-general-digest-unsubscribelists.php.net

    To post to the list, e-mail:
            php-generallists.php.net

    ----------------------------------------------------------------------

    attached mail follows:


    Thanks Lars.

    Sorry, then I have another question. How do I find the size of the record?

    Thanks
    Denis
    ----- Original Message -----
    From: "Lars Olsson" <lassolassoweb.nu>
    To: "Denis L. Menezes" <menezesdsingnet.com.sg>
    Cc: "PHP general list" <php-generallists.php.net>
    Sent: Tuesday, January 14, 2003 9:36 PM
    Subject: [PHP] Re: Amount of data in the database

    > A pretty easy way of doing it is to add a size field to the table.
    > Whenever you INSERT INTO or UPDATE the table, update this field to
    > contain the size of the data for the current record. Then, whenever you
    > need to check the amount of data for a particular user, just use this
    query:
    >
    > "SELECT SUM(size) FROM sometable WHERE user=someuser"
    >
    > Hope this helps
    >
    >
    > /Lars Olsson (lassolassoweb.nu)
    >
    > PS. Ive done this in a file upload script I created a while ago. If you
    > want, I can mail you the relevant bits and bytes. DS.
    >
    >
    >
    > Denis L. Menezes wrote:
    > > Hello friends.
    > >
    > > I have a need for checking how much data(in kb) exists of each of the
    user members in the MySQL so that when they upload more data I can
    restrict/warn them of the amount of data they have on the server at present.
    > >
    > > can anyone please tell me how to check the amount of data on the mysql
    for each record?
    > >
    > > thanks very much
    > > Denis
    >
    >
    > --
    > PHP General Mailing List (http://www.php.net/)
    > To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    Hello again!

    Basically...you can't. What I meant was that when you insert the data
    into the table, you need to store the size as well.

    Consider the following table (called files):

    dataID user filename size filedata
    [int, autoincremented] [int] [varchar] [int] [blob]

    Now, let's say user 3 uploads the file 'airplane.jpg' to the server. We
    need to have the following information:

    $filename = The name of the file
    $filedata = The actual file
    $size = The size of the uploaded file

    You can find out about how to get these variables from
    http://www.php.net/manual/en/features.file-upload.php

    Then you insert the data into your table;

    "INSERT INTO files(user, filename, size, filedata)
            VALUES (3, $filename, $size, $filedata)"

    This means that every time some user upload a file, the size of the file
      will be tied to a particular record. Then you just use MySQLs built-in
    SUM function to find out the total amount of data (check my previous post)

    Kindly

    /Lars Olsson (lassolassoweb.nu)

    Denis L. Menezes wrote:
    > Thanks Lars.
    >
    > Sorry, then I have another question. How do I find the size of the record?
    >
    > Thanks
    > Denis

    attached mail follows:


    Does anyone know any reliable php/mysql mail-clients with support for pop3?

    Yours

    Henning

    attached mail follows:


    I use and recommend Squirrelmail.
    http://www.squirrelmail.org/

    Steven Balthazor
    -----Original Message-----
    From: Henning Olsen [mailto:henningolsen36netscape.net]
    Sent: Tuesday, January 14, 2003 7:03 AM
    To: php-generallists.php.net
    Subject: [PHP] mail client?

    Does anyone know any reliable php/mysql mail-clients with support for pop3?

    Yours

    Henning

    -- 
    PHP General Mailing List (http://www.php.net/)
    To unsubscribe, visit: http://www.php.net/unsub.php
    

    attached mail follows:


    On Tuesday 14 January 2003 22:45, Steven Balthazor wrote: > I use and recommend Squirrelmail. > http://www.squirrelmail.org/

    Squirrelmail doesn't support POP3 on it's own which is what the OP wanted.

    -- 
    Jason Wong -> Gremlins Associates -> www.gremlins.biz
    Open Source Software Systems Integrators
    * Web Design & Hosting * Internet & Intranet Applications Development *
    

    /* When we are planning for posterity, we ought to remember that virtue is not hereditary. -- Thomas Paine */

    attached mail follows:


    > Does anyone know any reliable php/mysql mail-clients with support for pop3?

    IMP perhaps ?

    Have a look over at http://www.horde.org/

    attached mail follows:


    cookies?

    ----- Original Message ----- From: "Mathias Rockel" <mr.phppfaffendorf-consulting.com> To: <php-generallists.php.net> Sent: Tuesday, January 14, 2003 7:33 AM Subject: [PHP] Persistent global data ?

    Hi all !

    I am currently writing some kind of Document/File-Library in a LAMP environment.

    As the library should be able to handle various file types, and most file types have to be handled differently internally, I would like to use Objects/Classes to make the code for the Library iself independent from the stuff that is individual to the different file types.

    Now I noticed early that when I use Objects in PHP and have to create many for them each time a script runs it slows the system down considerably. It seems you can now save objects in sessions which AFAIR was not possible last time I tried. But then I would have to read the whole file index (which is actually a tree) into a session variable for each user, and I don't know if thats a good idea performancewise. It would be a rather large multi-dimensional array.

    So I would like to know if there is any possibility in PHP to create my own persistent superglobal, a variable which can be read by any script running. I think something similiar is available as the "Application" Object in ASP under IIS. I know I have to take care of locking and stuff (although the end-user scripts would only need read access to it), but if I could write some functions which just would check if the tree is already in memory or not (after a server shutdown or whatever), and if not just read it in from the database to make it available in every other script.

    The only thing I've found so far which I think may be a possibility is the shared memory stuff that PHP supports, but I don't know anything about that on the system level, and its not explained in much detail in the PHP manual. Is that something I should follow, or can't I use it ? Can I somehow use the underlying Apache ? Are there better options ?

    any help/suggestions/hints are greatly appreciated !

    mathias rockel

    -- 
    PHP General Mailing List (http://www.php.net/)
    To unsubscribe, visit: http://www.php.net/unsub.php
    

    attached mail follows:


    Hi!

    I'm not sure if that would be a good idea in respect to performance, also AFAIR cookies cannot save objects (can they?), and there are size limitations on cookies, so I probably cannot use them because they could not contain all the data ... and also, if I have the complete file structure saved on the client side its very easy to modify the data, possibly getting access to stuff that is not meant to be seen ... no cookies =).

    thanks anyway !

    mathias rockel

    ----- Original Message ----- From: "Rick Emery" <remeryemeryloftus.com> To: "Mathias Rockel" <mr.phppfaffendorf-consulting.com>; <php-generallists.php.net> Sent: Tuesday, January 14, 2003 3:06 PM Subject: Re: [PHP] Persistent global data ?

    > cookies? > > ----- Original Message ----- > From: "Mathias Rockel" <mr.phppfaffendorf-consulting.com> > To: <php-generallists.php.net> > Sent: Tuesday, January 14, 2003 7:33 AM > Subject: [PHP] Persistent global data ? > > > Hi all ! > > I am currently writing some kind of Document/File-Library in a LAMP > environment. > > As the library should be able to handle various file types, and most file > types have to be handled differently internally, I would like to use > Objects/Classes to make the code for the Library iself independent from the > stuff that is individual to the different file types. > > Now I noticed early that when I use Objects in PHP and have to create many > for them each time a script runs it slows the system down considerably. It > seems you can now save objects in sessions which AFAIR was not possible last > time I tried. But then I would have to read the whole file index (which is > actually a tree) into a session variable for each user, and I don't know if > thats a good idea performancewise. It would be a rather large > multi-dimensional array. > > So I would like to know if there is any possibility in PHP to create my own > persistent superglobal, a variable which can be read by any script running. > I think something similiar is available as the "Application" Object in ASP > under IIS. I know I have to take care of locking and stuff (although the > end-user scripts would only need read access to it), but if I could write > some functions which just would check if the tree is already in memory or > not (after a server shutdown or whatever), and if not just read it in from > the database to make it available in every other script. > > The only thing I've found so far which I think may be a possibility is the > shared memory stuff that PHP supports, but I don't know anything about that > on the system level, and its not explained in much detail in the PHP manual. > Is that something I should follow, or can't I use it ? Can I somehow use the > underlying Apache ? Are there better options ? > > any help/suggestions/hints are greatly appreciated ! > > mathias rockel > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > >

    attached mail follows:


    Write persistent data to a file on server side

    ----- Original Message ----- From: "Mathias Rockel" <mr.phppfaffendorf-consulting.com> To: <php-generallists.php.net> Sent: Tuesday, January 14, 2003 8:12 AM Subject: Re: [PHP] Persistent global data ?

    Hi!

    I'm not sure if that would be a good idea in respect to performance, also AFAIR cookies cannot save objects (can they?), and there are size limitations on cookies, so I probably cannot use them because they could not contain all the data ... and also, if I have the complete file structure saved on the client side its very easy to modify the data, possibly getting access to stuff that is not meant to be seen ... no cookies =).

    thanks anyway !

    mathias rockel

    ----- Original Message ----- From: "Rick Emery" <remeryemeryloftus.com> To: "Mathias Rockel" <mr.phppfaffendorf-consulting.com>; <php-generallists.php.net> Sent: Tuesday, January 14, 2003 3:06 PM Subject: Re: [PHP] Persistent global data ?

    > cookies? > > ----- Original Message ----- > From: "Mathias Rockel" <mr.phppfaffendorf-consulting.com> > To: <php-generallists.php.net> > Sent: Tuesday, January 14, 2003 7:33 AM > Subject: [PHP] Persistent global data ? > > > Hi all ! > > I am currently writing some kind of Document/File-Library in a LAMP > environment. > > As the library should be able to handle various file types, and most file > types have to be handled differently internally, I would like to use > Objects/Classes to make the code for the Library iself independent from the > stuff that is individual to the different file types. > > Now I noticed early that when I use Objects in PHP and have to create many > for them each time a script runs it slows the system down considerably. It > seems you can now save objects in sessions which AFAIR was not possible last > time I tried. But then I would have to read the whole file index (which is > actually a tree) into a session variable for each user, and I don't know if > thats a good idea performancewise. It would be a rather large > multi-dimensional array. > > So I would like to know if there is any possibility in PHP to create my own > persistent superglobal, a variable which can be read by any script running. > I think something similiar is available as the "Application" Object in ASP > under IIS. I know I have to take care of locking and stuff (although the > end-user scripts would only need read access to it), but if I could write > some functions which just would check if the tree is already in memory or > not (after a server shutdown or whatever), and if not just read it in from > the database to make it available in every other script. > > The only thing I've found so far which I think may be a possibility is the > shared memory stuff that PHP supports, but I don't know anything about that > on the system level, and its not explained in much detail in the PHP manual. > Is that something I should follow, or can't I use it ? Can I somehow use the > underlying Apache ? Are there better options ? > > any help/suggestions/hints are greatly appreciated ! > > mathias rockel > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > >

    -- 
    PHP General Mailing List (http://www.php.net/)
    To unsubscribe, visit: http://www.php.net/unsub.php
    

    attached mail follows:


    Hi!

    Yeah I know, but as I wrote below then I would need to put the complete file library into each users session, which first blows that up considerably, and scond probably is also slower as it is still read by each single script from hard disk (session data file) and the objects are recreated ... what I'm looking for is a superglobal which is actually never destroyed until the server is shut down ... one that is in memory until I explicitely destroy it ... and that is available to each script that is run without the need to create a copy each time ...

    mathias rockel

    ----- Original Message ----- From: "Jason Sheets" <jsheetsshadotech.com> To: "Mathias Rockel" <mr.phppfaffendorf-consulting.com> Sent: Tuesday, January 14, 2003 3:26 PM Subject: Re: [PHP] Persistent global data ?

    > Take a look at sessions, $_SESSION is already a super global. > > If you want to store an object I believe you have to serialize() it > first. > > Jason > > > On Tue, 2003-01-14 at 06:33, Mathias Rockel wrote: > > Hi all ! > > > > I am currently writing some kind of Document/File-Library in a LAMP > > environment. > > > > As the library should be able to handle various file types, and most file > > types have to be handled differently internally, I would like to use > > Objects/Classes to make the code for the Library iself independent from the > > stuff that is individual to the different file types. > > > > Now I noticed early that when I use Objects in PHP and have to create many > > for them each time a script runs it slows the system down considerably. It > > seems you can now save objects in sessions which AFAIR was not possible last > > time I tried. But then I would have to read the whole file index (which is > > actually a tree) into a session variable for each user, and I don't know if > > thats a good idea performancewise. It would be a rather large > > multi-dimensional array. > > > > So I would like to know if there is any possibility in PHP to create my own > > persistent superglobal, a variable which can be read by any script running. > > I think something similiar is available as the "Application" Object in ASP > > under IIS. I know I have to take care of locking and stuff (although the > > end-user scripts would only need read access to it), but if I could write > > some functions which just would check if the tree is already in memory or > > not (after a server shutdown or whatever), and if not just read it in from > > the database to make it available in every other script. > > > > The only thing I've found so far which I think may be a possibility is the > > shared memory stuff that PHP supports, but I don't know anything about that > > on the system level, and its not explained in much detail in the PHP manual. > > Is that something I should follow, or can't I use it ? Can I somehow use the > > underlying Apache ? Are there better options ? > > > > any help/suggestions/hints are greatly appreciated ! > > > > mathias rockel > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    Hi all !

    It seems I did not state exactly enough what I need ... if I use the $_SESSION functions or write the stuff myself makes no difference, actually then I can just leave it in the database and read it every time ... but that is just slow ... I want to create it persistant in the system memory so every script can access the contents without having to recreate the whole tree each time ...

    mathias rockel

    ----- Original Message ----- From: "Rick Emery" <remeryemeryloftus.com> To: "Mathias Rockel" <mr.phppfaffendorf-consulting.com>; <php-generallists.php.net> Sent: Tuesday, January 14, 2003 3:30 PM Subject: Re: [PHP] Persistent global data ?

    > Write persistent data to a file on server side > > ----- Original Message ----- > From: "Mathias Rockel" <mr.phppfaffendorf-consulting.com> > To: <php-generallists.php.net> > Sent: Tuesday, January 14, 2003 8:12 AM > Subject: Re: [PHP] Persistent global data ? > > > Hi! > > I'm not sure if that would be a good idea in respect to performance, also > AFAIR cookies cannot save objects (can they?), and there are size > limitations on cookies, so I probably cannot use them because they could not > contain all the data ... and also, if I have the complete file structure > saved on the client side its very easy to modify the data, possibly getting > access to stuff that is not meant to be seen ... no cookies =). > > thanks anyway ! > > mathias rockel > > ----- Original Message ----- > From: "Rick Emery" <remeryemeryloftus.com> > To: "Mathias Rockel" <mr.phppfaffendorf-consulting.com>; > <php-generallists.php.net> > Sent: Tuesday, January 14, 2003 3:06 PM > Subject: Re: [PHP] Persistent global data ? > > > > cookies? > > > > ----- Original Message ----- > > From: "Mathias Rockel" <mr.phppfaffendorf-consulting.com> > > To: <php-generallists.php.net> > > Sent: Tuesday, January 14, 2003 7:33 AM > > Subject: [PHP] Persistent global data ? > > > > > > Hi all ! > > > > I am currently writing some kind of Document/File-Library in a LAMP > > environment. > > > > As the library should be able to handle various file types, and most file > > types have to be handled differently internally, I would like to use > > Objects/Classes to make the code for the Library iself independent from > the > > stuff that is individual to the different file types. > > > > Now I noticed early that when I use Objects in PHP and have to create many > > for them each time a script runs it slows the system down considerably. It > > seems you can now save objects in sessions which AFAIR was not possible > last > > time I tried. But then I would have to read the whole file index (which is > > actually a tree) into a session variable for each user, and I don't know > if > > thats a good idea performancewise. It would be a rather large > > multi-dimensional array. > > > > So I would like to know if there is any possibility in PHP to create my > own > > persistent superglobal, a variable which can be read by any script > running. > > I think something similiar is available as the "Application" Object in ASP > > under IIS. I know I have to take care of locking and stuff (although the > > end-user scripts would only need read access to it), but if I could write > > some functions which just would check if the tree is already in memory or > > not (after a server shutdown or whatever), and if not just read it in from > > the database to make it available in every other script. > > > > The only thing I've found so far which I think may be a possibility is the > > shared memory stuff that PHP supports, but I don't know anything about > that > > on the system level, and its not explained in much detail in the PHP > manual. > > Is that something I should follow, or can't I use it ? Can I somehow use > the > > underlying Apache ? Are there better options ? > > > > any help/suggestions/hints are greatly appreciated ! > > > > mathias rockel > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    http://www.php.net/manual/en/ref.shmop.php

    On Tue, 14 Jan 2003, Mathias Rockel wrote:

    > Hi all ! > > It seems I did not state exactly enough what I need ... if I use the > $_SESSION functions or write the stuff myself makes no difference, actually > then I can just leave it in the database and read it every time ... but that > is just slow ... I want to create it persistant in the system memory so > every script can access the contents without having to recreate the whole > tree each time ... > > mathias rockel > > ----- Original Message ----- > From: "Rick Emery" <remeryemeryloftus.com> > To: "Mathias Rockel" <mr.phppfaffendorf-consulting.com>; > <php-generallists.php.net> > Sent: Tuesday, January 14, 2003 3:30 PM > Subject: Re: Persistent global data ? > > > > Write persistent data to a file on server side > > > > ----- Original Message ----- > > From: "Mathias Rockel" <mr.phppfaffendorf-consulting.com> > > To: <php-generallists.php.net> > > Sent: Tuesday, January 14, 2003 8:12 AM > > Subject: Re: Persistent global data ? > > > > > > Hi! > > > > I'm not sure if that would be a good idea in respect to performance, also > > AFAIR cookies cannot save objects (can they?), and there are size > > limitations on cookies, so I probably cannot use them because they could > not > > contain all the data ... and also, if I have the complete file structure > > saved on the client side its very easy to modify the data, possibly > getting > > access to stuff that is not meant to be seen ... no cookies =). > > > > thanks anyway ! > > > > mathias rockel > > > > ----- Original Message ----- > > From: "Rick Emery" <remeryemeryloftus.com> > > To: "Mathias Rockel" <mr.phppfaffendorf-consulting.com>; > > <php-generallists.php.net> > > Sent: Tuesday, January 14, 2003 3:06 PM > > Subject: Re: Persistent global data ? > > > > > > > cookies? > > > > > > ----- Original Message ----- > > > From: "Mathias Rockel" <mr.phppfaffendorf-consulting.com> > > > To: <php-generallists.php.net> > > > Sent: Tuesday, January 14, 2003 7:33 AM > > > Subject: Persistent global data ? > > > > > > > > > Hi all ! > > > > > > I am currently writing some kind of Document/File-Library in a LAMP > > > environment. > > > > > > As the library should be able to handle various file types, and most > file > > > types have to be handled differently internally, I would like to use > > > Objects/Classes to make the code for the Library iself independent from > > the > > > stuff that is individual to the different file types. > > > > > > Now I noticed early that when I use Objects in PHP and have to create > many > > > for them each time a script runs it slows the system down considerably. > It > > > seems you can now save objects in sessions which AFAIR was not possible > > last > > > time I tried. But then I would have to read the whole file index (which > is > > > actually a tree) into a session variable for each user, and I don't know > > if > > > thats a good idea performancewise. It would be a rather large > > > multi-dimensional array. > > > > > > So I would like to know if there is any possibility in PHP to create my > > own > > > persistent superglobal, a variable which can be read by any script > > running. > > > I think something similiar is available as the "Application" Object in > ASP > > > under IIS. I know I have to take care of locking and stuff (although the > > > end-user scripts would only need read access to it), but if I could > write > > > some functions which just would check if the tree is already in memory > or > > > not (after a server shutdown or whatever), and if not just read it in > from > > > the database to make it available in every other script. > > > > > > The only thing I've found so far which I think may be a possibility is > the > > > shared memory stuff that PHP supports, but I don't know anything about > > that > > > on the system level, and its not explained in much detail in the PHP > > manual. > > > Is that something I should follow, or can't I use it ? Can I somehow use > > the > > > underlying Apache ? Are there better options ? > > > > > > any help/suggestions/hints are greatly appreciated ! > > > > > > mathias rockel > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    Hi!

    So this is the only way I guess ...

    Do you propose to serialize() the objects in the tree and write that data into a shared memory block, and then deserialize them at the beginning of each script that needs the data back into objects ? I would think that that would impose the same performance penaltys from creating the objects again (this seems to be what slows php down), only the reading process ist sped up ... not exactly what I would like, but seems PHP provides no other functionality ...

    mathias rockel

    ----- Original Message ----- From: "Philip Hallstrom" <philipadhesivemedia.com> To: "Mathias Rockel" <mr.phppfaffendorf-consulting.com> Cc: <php-generallists.php.net> Sent: Tuesday, January 14, 2003 5:26 PM Subject: [PHP] Re: Persistent global data ?

    > http://www.php.net/manual/en/ref.shmop.php > > On Tue, 14 Jan 2003, Mathias Rockel wrote: > > > Hi all ! > > > > It seems I did not state exactly enough what I need ... if I use the > > $_SESSION functions or write the stuff myself makes no difference, actually > > then I can just leave it in the database and read it every time ... but that > > is just slow ... I want to create it persistant in the system memory so > > every script can access the contents without having to recreate the whole > > tree each time ... > > > > mathias rockel > > > > ----- Original Message ----- > > From: "Rick Emery" <remeryemeryloftus.com> > > To: "Mathias Rockel" <mr.phppfaffendorf-consulting.com>; > > <php-generallists.php.net> > > Sent: Tuesday, January 14, 2003 3:30 PM > > Subject: Re: Persistent global data ? > > > > > > > Write persistent data to a file on server side > > > > > > ----- Original Message ----- > > > From: "Mathias Rockel" <mr.phppfaffendorf-consulting.com> > > > To: <php-generallists.php.net> > > > Sent: Tuesday, January 14, 2003 8:12 AM > > > Subject: Re: Persistent global data ? > > > > > > > > > Hi! > > > > > > I'm not sure if that would be a good idea in respect to performance, also > > > AFAIR cookies cannot save objects (can they?), and there are size > > > limitations on cookies, so I probably cannot use them because they could > > not > > > contain all the data ... and also, if I have the complete file structure > > > saved on the client side its very easy to modify the data, possibly > > getting > > > access to stuff that is not meant to be seen ... no cookies =). > > > > > > thanks anyway ! > > > > > > mathias rockel > > > > > > ----- Original Message ----- > > > From: "Rick Emery" <remeryemeryloftus.com> > > > To: "Mathias Rockel" <mr.phppfaffendorf-consulting.com>; > > > <php-generallists.php.net> > > > Sent: Tuesday, January 14, 2003 3:06 PM > > > Subject: Re: Persistent global data ? > > > > > > > > > > cookies? > > > > > > > > ----- Original Message ----- > > > > From: "Mathias Rockel" <mr.phppfaffendorf-consulting.com> > > > > To: <php-generallists.php.net> > > > > Sent: Tuesday, January 14, 2003 7:33 AM > > > > Subject: Persistent global data ? > > > > > > > > > > > > Hi all ! > > > > > > > > I am currently writing some kind of Document/File-Library in a LAMP > > > > environment. > > > > > > > > As the library should be able to handle various file types, and most > > file > > > > types have to be handled differently internally, I would like to use > > > > Objects/Classes to make the code for the Library iself independent from > > > the > > > > stuff that is individual to the different file types. > > > > > > > > Now I noticed early that when I use Objects in PHP and have to create > > many > > > > for them each time a script runs it slows the system down considerably. > > It > > > > seems you can now save objects in sessions which AFAIR was not possible > > > last > > > > time I tried. But then I would have to read the whole file index (which > > is > > > > actually a tree) into a session variable for each user, and I don't know > > > if > > > > thats a good idea performancewise. It would be a rather large > > > > multi-dimensional array. > > > > > > > > So I would like to know if there is any possibility in PHP to create my > > > own > > > > persistent superglobal, a variable which can be read by any script > > > running. > > > > I think something similiar is available as the "Application" Object in > > ASP > > > > under IIS. I know I have to take care of locking and stuff (although the > > > > end-user scripts would only need read access to it), but if I could > > write > > > > some functions which just would check if the tree is already in memory > > or > > > > not (after a server shutdown or whatever), and if not just read it in > > from > > > > the database to make it available in every other script. > > > > > > > > The only thing I've found so far which I think may be a possibility is > > the > > > > shared memory stuff that PHP supports, but I don't know anything about > > > that > > > > on the system level, and its not explained in much detail in the PHP > > > manual. > > > > Is that something I should follow, or can't I use it ? Can I somehow use > > > the > > > > underlying Apache ? Are there better options ? > > > > > > > > any help/suggestions/hints are greatly appreciated ! > > > > > > > > mathias rockel > > > > > > > > > > > > -- > > > > PHP General Mailing List (http://www.php.net/) > > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > > > > > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    > So this is the only way I guess ... > > Do you propose to serialize() the objects in the tree and write that data > into a shared memory block, and then deserialize them at the beginning of > each script that needs the data back into objects ? I would think that that > would impose the same performance penaltys from creating the objects again > (this seems to be what slows php down), only the reading process ist sped > up ... not exactly what I would like, but seems PHP provides no other > functionality ... > > mathias rockel There's another way with srm: http://www.vl-srm.net/doc/features.application-vars.php But I don't know if it's still maintaned.

    Arpi

    attached mail follows:


    Hello -

    I am trying to use a simple email script. When the php file is called, the browser just hangs. If I look in Task Manager, the php.exe has stopped - shows no activity. I am a PHP novice, so have tried several email scripts from the 'Net. Currently trying the PHP Email Responder from http://www.abspoel.com/roel-karin/download.php

    New install of 4.3.0 on Windows 2000 Server/IIS5 in CGI mode. Executables are in c:\php, php.ini in c:\winnt. I gave all "Read/Execute permissions by IUSR_machine" per documentation. Set register_globals = true, no change.

    If I run c:\php\php -i from a DOS prompt I get a screen full of output.

    Anyone can check out the config at: http://www.jernlaw.com/phpinfo.php

    Any suggestions greatly appreciated!

    Bil Click

    attached mail follows:


    I used mktime to make 1040601600 this stirng but I want to go back to human readable time how should I do that? Thanks, David

    attached mail follows:


    > I used mktime to make 1040601600 this stirng but I want to go back to > human readable time how should I do that?

    date(); The first argument is the format specifier and the second argument is a unix timestamp (ie, what mktime() returns).

    Chris

    attached mail follows:


    On Tuesday 14 January 2003 22:16, Davíð Örn Jóhannsson wrote: > I used mktime to make 1040601600 this stirng but I want to go back to > human readable time how should I do that?

    strftime()

    -- 
    Jason Wong -> Gremlins Associates -> www.gremlins.biz
    Open Source Software Systems Integrators
    * Web Design & Hosting * Internet & Intranet Applications Development *
    

    /* No question is so difficult as one to which the answer is obvious. */

    -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development *

    /* Happiness is a positive cash flow. */

    attached mail follows:


    > > I used mktime to make 1040601600 this stirng but I want to go back to > > human readable time how should I do that? > strftime()

    Wow, that's pretty cool. I never knew about that function. I just always used date(). There are so many different ways to do something and one of the main reasons I like this list so much is that you can learn alot of them.

    Chris

    attached mail follows:


    On Tuesday 14 January 2003 22:38, Chris Boget wrote: > > > I used mktime to make 1040601600 this stirng but I want to go back to > > > human readable time how should I do that? > > > > strftime() > > Wow, that's pretty cool. I never knew about that function. I just always > used date(). > There are so many different ways to do something and one of the main > reasons I like this list so much is that you can learn alot of them.

    The php manual makes wonderful bedtime reading material (for insomniacs who wants to to get some sleep).

    -- 
    Jason Wong -> Gremlins Associates -> www.gremlins.biz
    Open Source Software Systems Integrators
    * Web Design & Hosting * Internet & Intranet Applications Development *
    

    /* Bridge ahead. Pay troll. */

    attached mail follows:


    Ok, I know I have asked this question before and I have asked it on the db forum, on asp forums, java applet forums, searched google, etc but can't really seem to find anything. I have to come up with a way to move data from an access db to the mysql db on the webserver. If I have to, I can upload the access file to the server and then transfer the data. Are there tutorials or samples somewhere of how to do this in php?

    Best case scenario would be to come up with a way (using any tool, java, activex, etc) to connect to the users machine and then upload the data directly from there.

    ANY help would be greatly appreciated!

    THANKS, Eddie

    attached mail follows:


    try GOOGLE: access mysql php conversion

    I did ----- Original Message ----- From: "Edward Peloke" <epelokeechoman.com> To: "PHP general list" <php-generallists.php.net> Sent: Tuesday, January 14, 2003 8:48 AM Subject: [PHP] data move, Please Help..

    Ok, I know I have asked this question before and I have asked it on the db forum, on asp forums, java applet forums, searched google, etc but can't really seem to find anything. I have to come up with a way to move data from an access db to the mysql db on the webserver. If I have to, I can upload the access file to the server and then transfer the data. Are there tutorials or samples somewhere of how to do this in php?

    Best case scenario would be to come up with a way (using any tool, java, activex, etc) to connect to the users machine and then upload the data directly from there.

    ANY help would be greatly appreciated!

    THANKS, Eddie

    -- 
    PHP General Mailing List (http://www.php.net/)
    To unsubscribe, visit: http://www.php.net/unsub.php
    

    attached mail follows:


    thanks Rick, I did that and did find more stuff. I guess I need to find more odbc info so that I can use that to move the data over. After I have uploaded the file, can I create an odbc connection in php and then use php also to move data from access to the mysql db?

    Thanks, Eddie

    -----Original Message----- From: Rick Emery [mailto:remeryemeryloftus.com] Sent: Tuesday, January 14, 2003 9:33 AM To: Edward Peloke; PHP general list Subject: Re: [PHP] data move, Please Help..

    try GOOGLE: access mysql php conversion

    I did ----- Original Message ----- From: "Edward Peloke" <epelokeechoman.com> To: "PHP general list" <php-generallists.php.net> Sent: Tuesday, January 14, 2003 8:48 AM Subject: [PHP] data move, Please Help..

    Ok, I know I have asked this question before and I have asked it on the db forum, on asp forums, java applet forums, searched google, etc but can't really seem to find anything. I have to come up with a way to move data from an access db to the mysql db on the webserver. If I have to, I can upload the access file to the server and then transfer the data. Are there tutorials or samples somewhere of how to do this in php?

    Best case scenario would be to come up with a way (using any tool, java, activex, etc) to connect to the users machine and then upload the data directly from there.

    ANY help would be greatly appreciated!

    THANKS, Eddie

    --
    PHP General Mailing List (http://www.php.net/)
    To unsubscribe, visit: http://www.php.net/unsub.php
    

    attached mail follows:


    Has anyone uploaded a file and then used php to transfer the data between the two databases??

    -----Original Message----- From: Edward Peloke [mailto:epelokeechoman.com] Sent: Tuesday, January 14, 2003 10:27 AM To: PHP general list Subject: RE: [PHP] data move, Please Help..

    thanks Rick, I did that and did find more stuff. I guess I need to find more odbc info so that I can use that to move the data over. After I have uploaded the file, can I create an odbc connection in php and then use php also to move data from access to the mysql db?

    Thanks, Eddie

    -----Original Message----- From: Rick Emery [mailto:remeryemeryloftus.com] Sent: Tuesday, January 14, 2003 9:33 AM To: Edward Peloke; PHP general list Subject: Re: [PHP] data move, Please Help..

    try GOOGLE: access mysql php conversion

    I did ----- Original Message ----- From: "Edward Peloke" <epelokeechoman.com> To: "PHP general list" <php-generallists.php.net> Sent: Tuesday, January 14, 2003 8:48 AM Subject: [PHP] data move, Please Help..

    Ok, I know I have asked this question before and I have asked it on the db forum, on asp forums, java applet forums, searched google, etc but can't really seem to find anything. I have to come up with a way to move data from an access db to the mysql db on the webserver. If I have to, I can upload the access file to the server and then transfer the data. Are there tutorials or samples somewhere of how to do this in php?

    Best case scenario would be to come up with a way (using any tool, java, activex, etc) to connect to the users machine and then upload the data directly from there.

    ANY help would be greatly appreciated!

    THANKS, Eddie

    --
    PHP General Mailing List (http://www.php.net/)
    To unsubscribe, visit: http://www.php.net/unsub.php
    

    -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    From previous experience with this problem - the most 'relaible' method for me was to

    (1) use the access/xls/whatever application to dump a CSV-type file (2) upload the file to the appropriate location on your MySQL server (3) write a PHJP script that use a standard LOAD DATA INFILE query.

    From the MySQL Docs ------------------------------------- 7.15 LOAD DATA INFILE syntax

    LOAD DATA [LOW_PRIORITY] [LOCAL] INFILE 'file_name.txt' [REPLACE | IGNORE] INTO TABLE tbl_name [FIELDS [TERMINATED BY '\t'] [OPTIONALLY] ENCLOSED BY ''] [ESCAPED BY '\\' ]] [LINES TERMINATED BY '\n'] [IGNORE number LINES] [(col_name,...)]

    The LOAD DATA INFILE statement reads rows from a text file into a table at a very high speed. If the LOCAL keyword is specified, the file is read from the client host. If LOCAL is not specified, the file must be located on the server. (LOCAL is available in MySQL 3.22.6 or later.) -------------------------------------

    HTH Tom Henry

    Rick Emery wrote: > try GOOGLE: access mysql php conversion > > I did > ----- Original Message ----- > From: "Edward Peloke" <epelokeechoman.com> > To: "PHP general list" <php-generallists.php.net> > Sent: Tuesday, January 14, 2003 8:48 AM > Subject: [PHP] data move, Please Help.. > > > Ok, I know I have asked this question before and I have asked it on the db > forum, on asp forums, java applet forums, searched google, etc but can't > really seem to find anything. I have to come up with a way to move data > from an access db to the mysql db on the webserver. If I have to, I can > upload the access file to the server and then transfer the data. Are there > tutorials or samples somewhere of how to do this in php? > > Best case scenario would be to come up with a way (using any tool, java, > activex, etc) to connect to the users machine and then upload the data > directly from there. > > ANY help would be greatly appreciated! > > THANKS, > Eddie > >

    attached mail follows:


    thanks Tom!

    I will play with this. I just don't want to ask the users to export the file to xls first, just want to have them hit a button and the data is uploaded...

    Eddie

    -----Original Message----- From: TomH [mailto:t.j.henrybusinesswebs.com] Sent: Tuesday, January 14, 2003 4:07 PM To: php-generallists.php.net Subject: Re: [PHP] data move, Please Help..

    From previous experience with this problem - the most 'relaible' method for me was to

    (1) use the access/xls/whatever application to dump a CSV-type file (2) upload the file to the appropriate location on your MySQL server (3) write a PHJP script that use a standard LOAD DATA INFILE query.

    From the MySQL Docs ------------------------------------- 7.15 LOAD DATA INFILE syntax

    LOAD DATA [LOW_PRIORITY] [LOCAL] INFILE 'file_name.txt' [REPLACE | IGNORE] INTO TABLE tbl_name [FIELDS [TERMINATED BY '\t'] [OPTIONALLY] ENCLOSED BY ''] [ESCAPED BY '\\' ]] [LINES TERMINATED BY '\n'] [IGNORE number LINES] [(col_name,...)]

    The LOAD DATA INFILE statement reads rows from a text file into a table at a very high speed. If the LOCAL keyword is specified, the file is read from the client host. If LOCAL is not specified, the file must be located on the server. (LOCAL is available in MySQL 3.22.6 or later.) -------------------------------------

    HTH Tom Henry

    Rick Emery wrote: > try GOOGLE: access mysql php conversion > > I did > ----- Original Message ----- > From: "Edward Peloke" <epelokeechoman.com> > To: "PHP general list" <php-generallists.php.net> > Sent: Tuesday, January 14, 2003 8:48 AM > Subject: [PHP] data move, Please Help.. > > > Ok, I know I have asked this question before and I have asked it on the db > forum, on asp forums, java applet forums, searched google, etc but can't > really seem to find anything. I have to come up with a way to move data > from an access db to the mysql db on the webserver. If I have to, I can > upload the access file to the server and then transfer the data. Are there > tutorials or samples somewhere of how to do this in php? > > Best case scenario would be to come up with a way (using any tool, java, > activex, etc) to connect to the users machine and then upload the data > directly from there. > > ANY help would be greatly appreciated! > > THANKS, > Eddie > >

    --
    PHP General Mailing List (http://www.php.net/)
    To unsubscribe, visit: http://www.php.net/unsub.php
    

    attached mail follows:


    Hi,

    Wednesday, January 15, 2003, 12:48:59 AM, you wrote: EP> Ok, I know I have asked this question before and I have asked it on the db EP> forum, on asp forums, java applet forums, searched google, etc but can't EP> really seem to find anything. I have to come up with a way to move data EP> from an access db to the mysql db on the webserver. If I have to, I can EP> upload the access file to the server and then transfer the data. Are there EP> tutorials or samples somewhere of how to do this in php?

    EP> Best case scenario would be to come up with a way (using any tool, java, EP> activex, etc) to connect to the users machine and then upload the data EP> directly from there.

    EP> ANY help would be greatly appreciated!

    EP> THANKS, EP> Eddie

    Maybe it is possible to use odbc to setup a link table in access so your data is always upto date, the only requirement being is a permanent link to the mysql server.

    -- 
    regards,
    Tom
    

    attached mail follows:


    I'd go the ODBC route. If you have a server running Windows and the MyODBC driver, write a simple script (asp, cold fusion, php, etc) that allows users to do a file upload of the access db. Setup up a DSN to that file, and have the same script that handles the upload trigger the process of moving the data from the access DB to the MySQL db using ODBC.

    One trick you'll need is that windows will lock the db whenever it's used, and leave it locked for however long the timeout is set on the DSN. So, you might want to add a bogus query that hits the access database and calls a column that doesn't exist, in order to break the DSN lock.

    HTH,

    Peter Janett

    New Media One Web Services ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ New Upgrades Are Now Live!!! Windows 2000 accounts - Cold Fusion 5.0 and Imail 7.1 Sun Solaris (UNIX) accounts - PHP 4.1.2, mod_perl/1.25, Stronghold/3.0 (Apache/1.3.22), MySQL 3.23.43 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PostgreSQL coming soon!

    http://www.newmediaone.net webmasternewmediaone.net (303)828-9882

    ----- Original Message ----- From: "Rick Emery" <remeryemeryloftus.com> To: "Edward Peloke" <epelokeechoman.com>; "PHP general list" <php-generallists.php.net> Sent: Tuesday, January 14, 2003 7:32 AM Subject: Re: [PHP] data move, Please Help..

    > try GOOGLE: access mysql php conversion > > I did > ----- Original Message ----- > From: "Edward Peloke" <epelokeechoman.com> > To: "PHP general list" <php-generallists.php.net> > Sent: Tuesday, January 14, 2003 8:48 AM > Subject: [PHP] data move, Please Help.. > > > Ok, I know I have asked this question before and I have asked it on the db > forum, on asp forums, java applet forums, searched google, etc but can't > really seem to find anything. I have to come up with a way to move data > from an access db to the mysql db on the webserver. If I have to, I can > upload the access file to the server and then transfer the data. Are there > tutorials or samples somewhere of how to do this in php? > > Best case scenario would be to come up with a way (using any tool, java, > activex, etc) to connect to the users machine and then upload the data > directly from there. > > ANY help would be greatly appreciated! > > THANKS, > Eddie > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    Lars, I use Win98 and Apache to test the .php script.

    My ISP has IIS. TR

    attached mail follows:


    Chris Hayes <chayesantenna.nl> ïèøåò â ñîîáùåíèè:5.1.0.14.0.20030114135652.02049c10pop4.antenna.nl... > > >in function i call to $smarty variable > >" > >function showLoginForm(){ > > > > global $db, $smarty; // $smarty = new Smarty in main code > >Fatal error: Call to a member function on a non-object in > > Are you sure > $smarty = new Smarty > is in the main code? > Can it be in another function? > > Try setting > global $smarty; > just before you create $smarty. > > Does that help? Thanks, that's nice help :)

    > > >( register_globals = off ) > >Imho, globals don't working with "globals off", nut i can't find this in > >manual. > no, register_globals is only about the automatical production of variables > from FORM, GET and other data input. > But i fully agree the name is confusing. >

    attached mail follows:


    instead of: global $smarty; $smarty]->assign("message", $message);

    try: $_GLOBAL['smarty']->assign("message", $message);

    Foong

    Michael Bevz <infomixa.kiev.ua> wrote in message news:20030114114614.88132.qmailpb1.pair.com... > Hi, all!!! > I've such trouble: > ( register_globals = off ) > > in function i call to $smarty variable > " > function showLoginForm(){ > > global $db, $smarty; // $smarty = new Smarty in main code > > $smarty->assign("message", $message); // !!!! > " > and i receive this error message > " > Fatal error: Call to a member function on a non-object in > /usr/home/elastic.org/work/svyatoshin/system/common_func.php on line 22 > " > > Imho, globals don't working with "globals off", nut i can't find this in > manual. > > Who can help me? > >

    attached mail follows:


    --- Danny Shepherd <dannykyboshed.com> wrote: > No, I wouldn't rely on it at all, I couldn't find a > browser that *does* have that mime-type in it's > header!

    Danny is right. The reason you cannot depend on the Accept header is that most browsers will include */* as an acceptable type (which basically means the browser will accept any type/subtype) and assign it the lowest quality factor.

    I cannot imagine a Web browser that will prefer Flash (assigning it anything but the lowest quality factor); maybe some Web developers should consider that when designing user interfaces. :-)

    Chris

    attached mail follows:


    --- "J. Alden Gillespy" <doggabowjackloren.com> wrote: > I'm creating an e-commerce website, and I just need > clarification as to whether a MySQL query is > considered as "browser output".

    It is not. However, a MySQL error is indeed output. Make sure your query is successful.

    My suggestion would be to simplify your code. Test your queries independently of setting cookies and redirecting. You have too many potential cases for error as it is, and that makes things difficult.

    > mysql_query("select * from `$cart->user_table` where > username=\"$username\" and userpass=\"$userpass\"", > $cart->dblink)

    I'm not sure if it is just formatting or my eyes, but it looks like you have backticks in your query. Also, you should consider using single quotes around your values rather than escaped double quotes.

    > setcookie("jackloren_user", "$username:$userpass", time() > + 2592000); > header("Location: http://www.jackloren.com/");

    You should test this combination separately. Depending on several factors, your cookie may not be getting set due to the Location header redirect. The combination works fine with most modern Web agents, but it has been known to pose problems for developers.

    Chris

    attached mail follows:


    You should not add any output after doing a "Location:" redirect. It's recommended to add an exit() after the header(). Proper browsers should halt their renderer and redirect when they find a Location: header.

    HTH, Vahan

    J. Alden Gillespy wrote: > I'm creating an e-commerce website, and I just need clarification as to > whether a MySQL query is considered as "browser output". I ask because > I have the following code, but the cookie isn't being set: > > if ($op == "login") { > if (!isset($username) && !isset($userpass)) { > } else { > if ($username == "" || $userpass == "") { > $errormsg = "Invalid username or password. > Please try again."; > } else { > if (mysql_num_rows(mysql_query("select * from > `$cart->user_table` where username=\"$username\" and > userpass=\"$userpass\"", $cart->dblink)) == 1) { > setcookie("jackloren_user", > "$username:$userpass", time() + 2592000); // expires in 30 days > header("Location: > http://www.jackloren.com/"); > // echo "test"; > /* if ($rd != "") { > redirectURL($rd,""); > } else { > redirectURL("",""); > } */ > } else { > $errormsg = "Invalid username or > password. Please try again."; > } > } > } > } > > However, if I comment out the header and uncomment the echo statement, > then the cookie is added, no problem. It seems as if the browser is > freaking out when there isn't any output after a cookie is set and a > header is sent. > > I'm also having another similar problem with this function: > > function auth($redirect_url) { > global $HTTP_COOKIE_VARS; > > if (!isset($HTTP_COOKIE_VARS['jackloren_user'])) { > header("Location: http://www.jackloren.com/login.php"); > // echo "test"; > } else { > $userinfo = explode(":", > $HTTP_COOKIE_VARS['jackloren_user']); > $username = $userinfo[0]; > $userpass = $userinfo[1]; > echo "$username | $userpass<br>"; > if (mysql_num_rows(mysql_query("select * from > `$cart->user_table` where username=\"$username\" and > userpass=\"$userpass\"", $cart->dblink)) != 1) { > redirectURL("login.php", $redirect_url); > } else { > echo "success"; > // nothing > } > } > } > > If I leave the script the way it is, the browser isn't redirected no > matter what I put in the header() statement. However, if I uncomment > the echo statement, giving the browser some output, then the redirect > works fine. > > Has anyone experienced this? And if so, how do I fix it? Thanks. > > J. Alden Gillespy (aka Dogga) > Microsoft Beta Tester: > - Office 11 > - Content Management Server (CMS) 2002 > - Systems Management Server (SMS) 2003 > >

    attached mail follows:


    On Monday 13 January 2003 18:09, Scott Fletcher wrote: > It's no problem. We're all very interesting in finding out what can work. > > Maybe I can help with one of this problem. The Gecko browser does have the > option of blocking the opening of hte unrequest window which is maybe why > yours doesn't work in Mozilla. Just wondeirng... No, the setting called "Open unrequested windows" is turned on in my browser (Mozilla 1.0.1), and all other settings on that page are also turned on, so I don't know why window.open call doesn't work in onunload event handler. By the way it's not a problem for me :)) I don't know if it works for the original poster. I try to always avoid using javascript, I think the session expiration is still a better way to force logging out a visitor who forgot to click on the logout button. Arpi

    attached mail follows:


    Me too. I alway try to avoid javascript. I have one workaround to the problem that keep me from having a headache with the browser incompatibilities. Since I already have a table in the database that deal with the session number, timestamp and user id. All I have to do is to detect the duplicate user id and check to see if if user is online for no more than 15 minutes by checking the timestamp. If more than 15 minutes then I deleted the existing session id then delete the duplicate user. When all goes well, then I create a new session id and insert it into the database along with the user id and a timestamp. And I do the manual clean up of the leftover session in the /tmp directory every few weeks. Not what I would like to have but there's nothing I can do about browser incompatibilities and javascript issues. If we're lucky, this would take 20 years or more for the problem to be fixed.

    "Tamas Arpad" <stsmail.xubion.hu> wrote in message news:200301141631.19667.stsmail.xubion.hu... On Monday 13 January 2003 18:09, Scott Fletcher wrote: > It's no problem. We're all very interesting in finding out what can work. > > Maybe I can help with one of this problem. The Gecko browser does have the > option of blocking the opening of hte unrequest window which is maybe why > yours doesn't work in Mozilla. Just wondeirng... No, the setting called "Open unrequested windows" is turned on in my browser (Mozilla 1.0.1), and all other settings on that page are also turned on, so I don't know why window.open call doesn't work in onunload event handler. By the way it's not a problem for me :)) I don't know if it works for the original poster. I try to always avoid using javascript, I think the session expiration is still a better way to force logging out a visitor who forgot to click on the logout button. Arpi

    attached mail follows:


    For those who don't mind working with Javascript I have found a method of maintaining the sessions to a minimum length. According to the Javascript list there is no way to get the url of the site the user is going to next so there is no way to tell if the onunload is due to a site change or the movement from one page on your site to another. So here is my solution...

    When the user logs on they are given a code that is derived from the time of login. Each pages checks that the decoded number results in a time of less than 8 hours from login. If it is greater than 8 they are just prompted to re-login. There will be a database entry for each time a page is loaded by the same user. This time is checked periodically, every 5 minutes should do. If they have not loaded a page in the last 5 minutes the session is removed. Now, each page that does not post anything will have a refresh set to 3 minutes so that people that have their browser set to the site in the background while they work on other programs etc. won't get kicked off.

    This has just been arrived at to solve the session destroy problem but it looks like it will work. I also don't know what this would do to a high volume site either but for me it should be workable. I hope this helps some.

    Larry S. Brown Dimension Networks, Inc. (727) 723-8388

    attached mail follows:


    I can't get my head around dealing with all the magic that PHP does to my data. I'm trying to do the following (in C++):

    char a = 'a'; a = a + 13;

    The resulting value of a is 'n'. If I do the equivalent in PHP ($a = "a"; $a += 13;) the resulting value is 13. I tried (int)$a += 13;, but that doesn't make a difference.

    Is there some "whole different way of thinking" I should be engaged in? Is there some way to make PHP add an int to the ASCII value of a single character string (since there seems to be no char type)?

    Thanks,

    Peter

    attached mail follows:


    Hi Peter,

    you're looking for "ord();"

    cu, Bastian

    > > Is there some way to make PHP add an int to the ASCII value of a single > character string (since there seems to be no char type)? > > Thanks, > > Peter

    attached mail follows:


    > -----Original Message----- > From: Peter Hutnick [mailto:peter-listshutnick.com] > Sent: 14 January 2003 15:49 > > I can't get my head around dealing with all the magic that > PHP does to my > data.

    You need to read, very carefully, several times, the PHP manual section on Type Juggling: http://www.php.net/manual/en/language.types.type-juggling.php

    > I'm trying to do the following (in C++): > > char a = 'a'; > a = a + 13; > > The resulting value of a is 'n'. If I do the equivalent in > PHP ($a = "a"; > $a += 13;) the resulting value is 13. I tried (int)$a += > 13;, but that > doesn't make a difference.

    Well, in an expression involving the arithmetic operators +-*/, and their assignment equivalents += etc, all values are automatically converted to numbers first -- and the numeric conversion of any string not starting with a digit is 0. So in your statement

    $a += 13

    the content of $a (="a") is first converted to an integer, giving zero, and then has 13 added to it -- hence 13.

    > Is there some "whole different way of thinking" I should be > engaged in?

    Yes -- probably several -- but in this case I'd say the concepts of loose typing and automatic type conversion which depends on context, as well as the way in which the various types get converted from one to another. Because automatic type-conversion is performed so frequently by PHP, there is actually very little use for the cast operators, although they do exist.

    > Is there some way to make PHP add an int to the ASCII value > of a single > character string (since there seems to be no char type)?

    You need ord() and chr() -- yes, PHP is not the most elegant language in this respect.

    (By the by, watch out for the behaviour of ++ and -- when applied to strings, as it probably isn't what you'd expect from the foregoing: {$b = "a"; $b++;} will result in $b containing "b"! And even then it's not straightforward or totally intuitive -- before you use this behaviour, figure out why {for ($a="a"; $a<="z"; $a++) echo $a;} *doesn't* display the letters from a to z!!)

    Cheers!

    Mike

    --------------------------------------------------------------------- Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: m.fordlmu.ac.uk Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

    attached mail follows:


    Hi, I'm having a big problem with php and Oracle.

    I'm using Oracle 8.1.6 and PHP 4.2 with the Oracle component in a Solaris server, I can not recompile apache and php to install the oci8 component and I'm having lot of problems with CLOBs, I'm receiving this error:

    Warning: Ora_Exec failed (ORA-00932: inconsistent datatypes -- while processing OCI function OEXEC/OEXN) in /var/www/espejo/includes/con.php on line 107

    Line 107 contains this code: Ora_Exec($this->cursor);

    The query is: SELECT Title, NewsDate, Content FROM inf_news WHERE ID_News = 5

    Where: Title is VarChar, NewsDate is Date and Content is a CLOB

    It works fine if the query doesn't contain the CLOB field.

    Any suggestion???

    Jadiel Flores ------------------------- http://www.abargon.com jfloresabargon.com (52-55) 52-29-80-34

    attached mail follows:


    Allen Byington <mailto:abyingtqwest.com> scribbled;

    [snip] > > *** Error Begins *** > Fatal error: Failed opening required 'includes/config.inc.php' > (include_path='/usr/local/lib/php') in > /opt/apache/htdocs/admin/includes/auth.inc.php on line 24 > *** Error Ends *** >

    You don't seem to have "." in your include_path, add it in your php.ini: include_path = "/usr/local/lib/php:."

    -jesse

    attached mail follows:


    I'm new to PHP and am slowly learning it. I have the following code that is giving me errors could someone take a look and suggest a fix?

    Parse error: parse error in /home/xxxxxxxx/public_html/Info/datain.php on line 7

    <HTML> <?php $db = mysql_connect("localhost", "xxxxxxxx","xxxxxxxxxx"); mysql_select_db("learndb",$db); $sql = "INSERT INTO personnel (firstname, lastname, nick, email, salary) VALUES ('$first','$last','$nickname',) $result = mysql_query'($sql); echo "Thank you! Information entered.\n"; ?> </HTML>

    --
    

    Thanks ______________________________ Brent Lee

    attached mail follows:


    Try this...

    $sql = "INSERT INTO personnel (firstname, lastname, nick, email, salary) VALUES ('$first','$last','$nickname',)";

    ----- Original Message ----- From: "Brent Lee" <brent.leesympatico.ca> To: <php-generallists.php.net> Sent: Tuesday, January 14, 2003 10:02 AM Subject: [PHP] Parse error

    > I'm new to PHP and am slowly learning it. I have the following code that is > giving me errors could someone take a look and suggest a fix? > > Parse error: parse error in /home/xxxxxxxx/public_html/Info/datain.php on > line 7 > > <HTML> > <?php > $db = mysql_connect("localhost", "xxxxxxxx","xxxxxxxxxx"); > mysql_select_db("learndb",$db); > $sql = "INSERT INTO personnel (firstname, lastname, nick, email, salary) > VALUES ('$first','$last','$nickname',) > $result = mysql_query'($sql); > echo "Thank you! Information entered.\n"; > ?> > </HTML> > > > > > -- > > Thanks > ______________________________ > Brent Lee > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    I'm new to PHP and am slowly learning it. I have the following code that is giving me errors could someone take a look and suggest a fix?

    Parse error: parse error in /home/xxxxxxxx/public_html/Info/datain.php on line 7

    <HTML> <?php $db = mysql_connect("localhost", "xxxxxxxx","xxxxxxxxxx"); mysql_select_db("learndb",$db); $sql = "INSERT INTO personnel (firstname, lastname, nick, email, salary) VALUES ('$first','$last','$nickname',)

    You are missing a ";" on the end of this, plus you need email and salary variables in the VALUES list, plus the list shouldn't end with a comma.

    Mark

    attached mail follows:


    Everything works great now. Thanks for the quick responses everyone.

    "Brent Lee" <brent.leesympatico.ca> wrote in message news:20030114160231.70820.qmailpb1.pair.com... > I'm new to PHP and am slowly learning it. I have the following code that is > giving me errors could someone take a look and suggest a fix? > > Parse error: parse error in /home/xxxxxxxx/public_html/Info/datain.php on > line 7 > > <HTML> > <?php > $db = mysql_connect("localhost", "xxxxxxxx","xxxxxxxxxx"); > mysql_select_db("learndb",$db); > $sql = "INSERT INTO personnel (firstname, lastname, nick, email, salary) > VALUES ('$first','$last','$nickname',) > $result = mysql_query'($sql); > echo "Thank you! Information entered.\n"; > ?> > </HTML> > > > > > -- > > Thanks > ______________________________ > Brent Lee > >

    attached mail follows:


    okay guys i have this script to use the first exploded part as the trigger then the rest sent in a msg, ive got the trigger but its just the message part im having probs with, how do i make it so anything after x is sent; in this i need $text to be set as it, any sort of help is greatly appreciated :-)

    /*CODE*/ <?php $string = "blah foo bar foo"; $ex = explode(" ",$string); if ($ex[0] == "blah") { $txt = "$ex[1] $ex[2] etc"; irc_privmsg($nick, $txt); } ?>

    - CS

    attached mail follows:


    Given: PHP 4.x PostgreSQL 7.3.x

    In 'psql' monitor: declare foo cursor for select * from humongous_table; move forward all in foo;

    The second query will print out a number which informs one of the actual number of rows that are in the cursor's query's result set, if one were to actually fetch them all. I would like to get to that number in PHP.

    Alas, as far as I can tell, there is to way to get that number through the PHP API...

    For sure: pg_num_rows -- only counts rows actually "fetched" pg_last_notice -- nope pg_result_error -- nope pg_result_status -- nope

    No other documented functions seem appropriate, though I may have missed one...

    attached mail follows:


    Here is another error I'm getting while trying to view my db. I copied and pasted these statements from a pdf file I'm using to learn PHP but they keep creating errors. I am writing all your tips into my notes to try to keep my questioning to a minimal.

    Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/xxxxxxx/public_html/Info/viewdb.php on line 8

    <HTML> <?php $db = mysql_connect('localhost', 'xxxxx', 'xxxxxxx'); mysql_select_db('learndb',$db); $result = mysql_query("SELECT * FROM personnel",$db); echo "<TABLE>"; echo"<TR><TD><B>Full Name</B><TD><B>Nick Name</B><TD><B>Salary</B></TR>"; while ($myrow = mysql_fetch_array($result)) { echo "<TR><TD>"; echo $myrow["firstname"]; echo " "; echo $myrow["lastname"]; echo "<TD>"; echo $myrow["nick"]; echo "<TD>"; echo $myrow["salary"]; } echo "</TABLE>"; ?> </HTML>

    --
    

    Thanks ______________________________ Brent Lee

    attached mail follows:


    On Wednesday 15 January 2003 00:53, Brent Lee wrote: > Here is another error I'm getting while trying to view my db. I copied > and pasted these statements from a pdf file I'm using to learn PHP but they > keep creating errors. > I am writing all your tips into my notes to try to keep my questioning > to a minimal.

    Another tip, please search the archives before you post. In 99% of cases your problem has already been encountered and resolved.

    > Warning: mysql_fetch_array(): supplied argument is not a valid MySQL > result resource in /home/xxxxxxx/public_html/Info/viewdb.php on line 8

    In cases like these searching the archives is a no brainer. Just plugin the error message and out pops your answer!

    -- 
    Jason Wong -> Gremlins Associates -> www.gremlins.biz
    Open Source Software Systems Integrators
    * Web Design & Hosting * Internet & Intranet Applications Development *
    

    /* The difference between dogs and cats is that dogs come when they're called. Cats take a message and get back to you. */

    attached mail follows:


    put the following line after you call mysql_query(..), you should be able to see the error:

    echo mysql_error();

    this line is very handy to see what's wrong with mysql related operation. Remember to delete it after debugging for security reasons

    Foong

    Brent Lee <brent.leesympatico.ca> wrote in message news:20030114165359.13769.qmailpb1.pair.com... > Here is another error I'm getting while trying to view my db. I copied > and pasted these statements from a pdf file I'm using to learn PHP but they > keep creating errors. > I am writing all your tips into my notes to try to keep my questioning > to a minimal. > > Warning: mysql_fetch_array(): supplied argument is not a valid MySQL > result resource in /home/xxxxxxx/public_html/Info/viewdb.php on line 8 > > > > <HTML> > <?php > $db = mysql_connect('localhost', 'xxxxx', 'xxxxxxx'); > mysql_select_db('learndb',$db); > $result = mysql_query("SELECT * FROM personnel",$db); > echo "<TABLE>"; > echo"<TR><TD><B>Full Name</B><TD><B>Nick Name</B><TD><B>Salary</B></TR>"; > while ($myrow = mysql_fetch_array($result)) > { > echo "<TR><TD>"; > echo $myrow["firstname"]; > echo " "; > echo $myrow["lastname"]; > echo "<TD>"; > echo $myrow["nick"]; > echo "<TD>"; > echo $myrow["salary"]; > } > echo "</TABLE>"; > ?> > </HTML> > > > -- > > Thanks > ______________________________ > Brent Lee > >

    attached mail follows:


    Hi folks

    I am having trouble writing a script to dump the data from tables in MYSQL. Can anyone provide help on how to use the mysqldump command within PHP (4.2).

    Many thanks

    Don

    www.complementarymedicines.com

    ---
    Outgoing mail is certified Virus Free.
    Checked by AVG anti-virus system (http://www.grisoft.com).
    Version: 6.0.435 / Virus Database: 244 - Release Date: 31/12/2002
    

    attached mail follows:


    On Wednesday 15 January 2003 00:50, Don Mc Nair wrote: > Hi folks > > I am having trouble writing a script to dump the data from tables in MYSQL. > Can anyone provide help on how to use the mysqldump command within PHP > (4.2).

    To execute shell commands from php use shell_exec() and friends.

    -- 
    Jason Wong -> Gremlins Associates -> www.gremlins.biz
    Open Source Software Systems Integrators
    * Web Design & Hosting * Internet & Intranet Applications Development *
    

    /* One way to make your old car run better is to look up the price of a new model. */

    attached mail follows:


    At 17:50 14-1-03, you wrote: I am having trouble writing a script to dump the data from tables in MYSQL. Can anyone provide help on how to use the mysqldump command within PHP (4.2).

    Many thanks

    Don

    Have a look at my wonderful script :) to use mysqldump to get yourself an email attachment of a complete database dump.

    It's a very helpful script, if you put it on debug mode it checks all sorts of things about mysqldump, like the accessability, it finds the path (on unix/linux) and it gives helpful comment. All support text is inside the file. http://www.hieris.info/over/backup/backup.php.txt

    Pick out what you need. I would like to get a copy of what you do with it.

    In case it turns out you do not have access to mysqldump i have made a hack on PHPmyAdmin to make it email the database as an atachment at a mouseclick.

    Chris Hayes

    attached mail follows:


    Hi, I wonder which is the better way to store data into database? 1. stor the data after we call htmlspecialchars with the data (means we store " as &quote; in database) 2. stor the data in non encoded form and call htmlspecialchars whenever we want to display it.

    Foong

    attached mail follows:


    --- Foong <chiew325tm.net.my> wrote: > I wonder which is the better way to store data into > database? > 1. stor the data after we call htmlspecialchars with the > data (means we store " as &quote; in database) > 2. stor the data in non encoded form and call > htmlspecialchars whenever we want to display it.

    Option 2.

    Please do not cross-post questions like this to the developer's list. This list (php-generallists.php.net) is the appropriate place for these types of questions.

    Chris

    attached mail follows:


    On Wednesday 15 January 2003 01:24, Foong wrote:

    > I wonder which is the better way to store data into database? > 1. stor the data after we call htmlspecialchars with the data (means we > store " as &quote; in database) > 2. stor the data in non encoded form and call htmlspecialchars whenever we > want to display it.

    It mostly depends on what you do with the data. For example:

    If you only store the data once (and never re-edit it) then use (1).

    If the data is used for other purposes as well (like gets sent in an email) then use (2).

    -- 
    Jason Wong -> Gremlins Associates -> www.gremlins.biz
    Open Source Software Systems Integrators
    * Web Design & Hosting * Internet & Intranet Applications Development *
    

    /* I wouldn't be so paranoid if you weren't all out to get me!! */

    attached mail follows:


    Thank you guys

    Foong

    Foong <chiew325tm.net.my> wrote in message news:20030114174418.46607.qmailpb1.pair.com... > Hi, > I wonder which is the better way to store data into database? > 1. stor the data after we call htmlspecialchars with the data (means we > store " as &quote; in database) > 2. stor the data in non encoded form and call htmlspecialchars whenever we > want to display it. > > Foong > > >

    attached mail follows:


    ---John W. Holmes...

    PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/

    > -----Original Message----- > From: Jason Wong [mailto:php-generalgremlins.biz] > Sent: Tuesday, January 14, 2003 1:09 PM > To: php-generallists.php.net > Subject: Re: [PHP] htmlspecialchars > > On Wednesday 15 January 2003 01:24, Foong wrote: > > > I wonder which is the better way to store data into database? > > 1. stor the data after we call htmlspecialchars with the data (means we > > store " as &quote; in database) > > 2. stor the data in non encoded form and call htmlspecialchars whenever > we > > want to display it. > > It mostly depends on what you do with the data. For example: > > If you only store the data once (and never re-edit it) then use (1). > > If the data is used for other purposes as well (like gets sent in an > email) > then use (2).

    Even if you're going to edit it, it's better to do htmlspecialchars() when you save the data. You have to do it anyhow, when you place it as the value of a text box.

    $value = 'This is "the" value';

    Now if you try to put that in a text box like this:

    <input type="text" value="<?=$value?>">

    Then you'll have problems. Yes, you can use single quotes, but then what happens when there is a single quote in the data?

    The best way to do it is to convert the special characters when you save it. The only exception to this would be if you ever want to use that data outside of HTML (i.e. mail, like you said).

    Hope that helps.

    ---John Holmes...

    attached mail follows:


    on 15/01/03 4:24 AM, Foong (chiew325tm.net.my) wrote:

    > Hi, > I wonder which is the better way to store data into database? > 1. stor the data after we call htmlspecialchars with the data (means we > store " as &quote; in database) > 2. stor the data in non encoded form and call htmlspecialchars whenever we > want to display it.

    I'm a firm believer in option 2...store it 'as-is' and adapt it to suit different environments (HTML, XML, CSV, Email, Wap, whatever)... however, if, forexample, it was a long article that gets read 1000's of times a day, and is unlikely ever to be ported into an email, or to other formats, then it makes perfect sense to get the content right once, and never worry about it again...

    Justin

    attached mail follows:


    Hi, I'm having a big problem with php4 and Oracle 8.1.6 and I'd like to know if anybody knows how to handle CLOB fields using oracle's functions.

    Thanks.

    Jadiel Flores ------------------------- http://www.abargon.com jfloresabargon.com (52-55) 52-29-80-34

    attached mail follows:


    I've got an array of values, that I need to query against a database to see if any records have any of the values in the array - the array is a list of zip codes, and the database contains a list of stores. Basically i need to find what stores have zip codes in the array.

    I know that mysql doesn't support subquerys - is there a workaround for this kind of scenario?

    TIA,

    Kelly

    attached mail follows:


    On Wednesday 15 January 2003 01:47, Kelly Meeks wrote: > I've got an array of values, that I need to query against a database to see > if any records have any of the values in the array - the array is a list of > zip codes, and the database contains a list of stores. Basically i need to > find what stores have zip codes in the array. > > I know that mysql doesn't support subquerys - is there a workaround for > this kind of scenario?

    This is more of a mysql question and should be asked on the php-db list if not the mysql list.

    What you need is something like:

    "SELECT doo FROM dah WHERE dee IN('val1', 'val2', ..., 'valN'"

    -- 
    Jason Wong -> Gremlins Associates -> www.gremlins.biz
    Open Source Software Systems Integrators
    * Web Design & Hosting * Internet & Intranet Applications Development *
    

    /* PEGGY FLEMMING is stealing BASKET BALLS to feed the babies in VERMONT. */

    attached mail follows:


    hope this help

    // array of zip codes $zips = array(...);

    // can use implode() here if you want foreach($zips as $zip) { $zip_list = ",'".$zip."'"; }

    // take away the first comma $zip_list = substr( $zip_list, 1);

    $sql = "SELECT stores FROM store_table WHERE zip_code IN('$zip_list')";

    $hdl = mysql_query($hdl);

    Foong

    Kelly Meeks <inforightangleinc.com> wrote in message news:009c01c2bbf5$03496b00$6901a8c0yourw92p4bhlzg... I've got an array of values, that I need to query against a database to see if any records have any of the values in the array - the array is a list of zip codes, and the database contains a list of stores. Basically i need to find what stores have zip codes in the array.

    I know that mysql doesn't support subquerys - is there a workaround for this kind of scenario?

    TIA,

    Kelly

    attached mail follows:


    Pretty much of a newbie so please bear with the stupidity.

    I have PHP 4.0.6 installed from rpm as part of RH 7.2. phpinfo() shows the configure command having --without-mysql. But my php scripts seeem to be able to run mysql commands happily.

    Could anybody point out why ? Doin rpm -aq | grep php shows me that php-mysql-4.0.6-7 is installed, maybe something to do with this.

    Thank you

    gamin.

    attached mail follows:


    On Tuesday 14 January 2003 19:16, gamin wrote: > I have PHP 4.0.6 installed from rpm as part of RH 7.2. phpinfo() shows the > configure command having --without-mysql. But my php scripts seeem to be > able to run mysql commands happily. > > Could anybody point out why ? Doin rpm -aq | grep php shows me that > php-mysql-4.0.6-7 is installed, maybe something to do with this.

    Yes, the last part is the imortant ;-) The PHP-MySQL-Extension was compile as shared extension. It is included in your php.ini file with a command sth. like extension=php_mysql.so

    johannes

    attached mail follows:


    "Johannes Schlueter" <phpschlueters.de> wrote in message news:200301141921.26328.phpschlueters.de... Yes, the last part is the imortant ;-) The PHP-MySQL-Extension was compile as shared extension. It is included in your php.ini file with a command sth. like extension=php_mysql.so

    johannes

    Thx Johannes for pointing this out. In the php.ini file i have extension=mysql.so Now i have another webserver running PHP where the configure command has --with-mysql=shared. I guess this means the same thing. Please could you second that and remove all doubts.

    thx

    g

    attached mail follows:


    On Tuesday 14 January 2003 19:54, gamin wrote: > Thx Johannes for pointing this out. In the php.ini file i have

    Your welcome ;-)

    > extension=mysql.so Now i have another webserver running PHP where the > configure command has --with-mysql=shared. I guess this means the same > thing. Please could you second that and remove all doubts.

    There is a small difference, if configured using --with-mysql=shared when running make it makes a php binary AND the mysql.so. If congigured --without-mysql and then run make it makes only the php binary then you need to make the mysql.so yourself (cd ext/mysql; phpize; configure; make). But finally you'll get the same result.

    johannes

    attached mail follows:


    "Johannes Schlueter" <phpschlueters.de> wrote in message news:200301142006.26021.phpschlueters.de... On Tuesday 14 January 2003 19:54, gamin wrote: > Thx Johannes for pointing this out. In the php.ini file i have

    Your welcome ;-)

    > extension=mysql.so Now i have another webserver running PHP where the > configure command has --with-mysql=shared. I guess this means the same > thing. Please could you second that and remove all doubts.

    There is a small difference, if configured using --with-mysql=shared when running make it makes a php binary AND the mysql.so.

    How does it make mysql.so, using some code that is provided with the PHP source or something that is already on the system (it looks for mysql on the system) ?

    If congigured --without-mysql and then run make it makes only the php binary then you need to make the mysql.so yourself (cd ext/mysql; phpize; configure; make).

    I did not understand how to make mysql.so myself ? Not that i will be doing this, but it is good to know and understand. Could you elaborate for the benifit of a beginner. Thx again

    But finally you'll get the same result.

    johannes

    attached mail follows:


    Hi all,

    I want to develop a script that can read an e-mail from a pop account, and then perform actions on that e-mail based on characteristics of the e-mail (e.g. header information, attachments, etc)

    Does anyone know of a way to receive e-mails via php, and then to parse them easily. My assumption would be that there should be a class out there somewhere that handles it well.

    Thanks

    David Russell IT Support Manager Barloworld Optimus (Pty) Ltd Tel: +2711 444-7250 Fax: +2711 444-7256 e-mail: DavidRBarloworldOptimus.com web: www.BarloworldOptimus.com


    • application/x-pkcs7-signature attachment: smime.p7s

    attached mail follows:


    You could use fetchmail to get the mail and pipe it into your php script which would see it as standard input...

    Or look on zend.com for a POP class...

    On Tue, 14 Jan 2003, David Russell wrote:

    > Hi all, > > I want to develop a script that can read an e-mail from a pop account, > and then perform actions on that e-mail based on characteristics of the > e-mail (e.g. header information, attachments, etc) > > Does anyone know of a way to receive e-mails via php, and then to parse > them easily. My assumption would be that there should be a class out > there somewhere that handles it well. > > Thanks > > David Russell > IT Support Manager > Barloworld Optimus (Pty) Ltd > Tel: +2711 444-7250 > Fax: +2711 444-7256 > e-mail: DavidRBarloworldOptimus.com > web: www.BarloworldOptimus.com >

    attached mail follows:


    Tyler BIRD <mailto:BIRDTYuvsc.edu> scribbled;

    > I'm trying to include > 'http://www.myserver.com/conted/me.inc'; > portably on several mirrored servers like include > '/conted/me.inc' > , I was wondering if there was someway I could include > files and have the implicity connect > and down the load me.inc from the local server whatever server it > happens to be on. > [snip] > > for example > on web2 box > include 'conted/me.inc'; works fine >

    This example should work on both, as it is a relative path.

    Unless you mean you want all the mirrored servers to read off your ONE URL, then you can include that whole URL (but I think that would defeat the purpose of mirroring if they all read off main site)

    attached mail follows:


    Hi, I'm about to start a new project which will require a login system. The system should allow for different types of access on a per page basis. I'm going to achieve the login system using sessions, which I have done before.

    My problem is that I don't want to have to do much login checking on the actual pages within the system. I would like it to be included and handled oustide of the main application.

    <?php /* authenticate */ $page_permission = 'admin'; include('includes/login.inc');

    /* other page functionality */

    ?>

    So, you set the permission for the individual page. I would also like to do this as a class, which I am not experienced in. I haven't found any very elegent solutions to this. Could anyone point out some urls or anything to show me in the right direction?

    Cheers, Jord

    -- 
    Jordan Elver
    There's no 'I' in 'team'. But then there's no 'I' in 'useless smug colleague', 
    either. And there's four in 'platitude-quoting idiot'. Go figure. -- David 
    Brent (The Office)
    

    attached mail follows:


    Devarticles has a series of Authentication tutorails and the a tutorial on OOP itself. Here are the links:

    http://www.devarticles.com/art/1/349

    -- Member Script Tutorial: -- -- There are 6 parts --

    http://www.devarticles.com/art/1/241 http://www.devarticles.com/art/1/245 http://www.devarticles.com/art/1/262 http://www.devarticles.com/art/1/285 http://www.devarticles.com/art/1/323

    Part six isn't up yet so check back to the same site later...

    ----- Original Message ----- From: "Jordan Elver" <jordan.elverdsl.pipex.com> To: <php-generallists.php.net> Sent: Tuesday, January 14, 2003 3:07 PM Subject: [PHP] Authentication programming

    : Hi, : I'm about to start a new project which will require a login system. The system : should allow for different types of access on a per page basis. I'm going to : achieve the login system using sessions, which I have done before. : : My problem is that I don't want to have to do much login checking on the : actual pages within the system. I would like it to be included and handled : oustide of the main application. : : <?php : /* authenticate */ : $page_permission = 'admin'; : include('includes/login.inc'); : : /* other page functionality */ : : ?> : : So, you set the permission for the individual page. I would also like to do : this as a class, which I am not experienced in. I haven't found any very : elegent solutions to this. Could anyone point out some urls or anything to : show me in the right direction? : : Cheers, : Jord : -- : Jordan Elver : There's no 'I' in 'team'. But then there's no 'I' in 'useless smug colleague', : either. And there's four in 'platitude-quoting idiot'. Go figure. -- David : Brent (The Office) : : : -- : PHP General Mailing List (http://www.php.net/) : To unsubscribe, visit: http://www.php.net/unsub.php : : :

    attached mail follows:


    on 15/01/03 7:07 AM, Jordan Elver (jordan.elverdsl.pipex.com) wrote:

    > Hi, > I'm about to start a new project which will require a login system. The system > should allow for different types of access on a per page basis. I'm going to > achieve the login system using sessions, which I have done before. > > My problem is that I don't want to have to do much login checking on the > actual pages within the system. I would like it to be included and handled > oustide of the main application.

    yes

    > <?php > /* authenticate */ > $page_permission = 'admin'; > include('includes/login.inc'); > > /* other page functionality */ > > ?>

    yes same thing I do

    > So, you set the permission for the individual page. I would also like to do > this as a class, which I am not experienced in. I haven't found any very > elegent solutions to this. Could anyone point out some urls or anything to > show me in the right direction?

    it's not *exactly* what you want at all, but if you've got a brain, you can adapat the concept to what you want with ease (I have)... there is an article on sitepoint.com / webmasterbase.com by kevin yank.

    http://www.WebmasterBase.com/article/319

    basically, he ends up with a script called 'restricted.php' which he includes at the top of any page which he wants to restrict to logged in users only...

    it works fine, but needs updating to account for $_POST/GET/SESSION etc, but should give you the principals to adapt or write your own.

    Cheers,

    Justin

    attached mail follows:


    Hi

    I just installed MySQL and PHP on Windows, and I have found that I am getting all sorts of errors (in both) when I try to use some of the same commands I use in the Linux versions. Are their a lot of differences in the two, and where can I find out what these are - I just got used to using them in Linux....

    TIA

    attached mail follows:


    The php.ini in both are whatever the default settings for these files are. If the defaults are different, then maybe - but I have no idea about these files, and really don't want to get into it. If the default doesn't work on Windows I will just scrap it. Not worth the head aches. Same with MySQL - getting errors as well where I get none in Linux.

    Thanks for the info.... ----- Original Message ----- From: JanetValaol.com To: beauford.2002rogers.com Sent: Tuesday, January 14, 2003 4:02 PM Subject: Re: [PHP] Windows vs Linux

    In a message dated 1/14/2003 12:45:03 PM Pacific Standard Time, beauford.2002rogers.com writes:

    I just installed MySQL and PHP on Windows, and I have found that I am getting all sorts of errors (in both) when I try to use some of the same commands I use in the Linux versions. Are their a lot of differences in the two, and where can I find out what these are - I just got used to using them in Linux....

    There really aren't any differences. Scripts that run on one, run on the other. The differences you are experiencing probably have to do with different settings. For isntance, you might have the error reporting level settings different. Or you might have register_globals set on in one and set off in the other. You need to check your php.ini files and make sure the settings are the same.

    Janet

    attached mail follows:


    Message-ID: <20030114204648.77860.qmailpb1.pair.com> To: php-generallists.php.net From: "Scott Fletcher" <scottabcoa.com> Date: Tue, 14 Jan 2003 15:52:06 -0500 Subject: emptying hte array??

    How to do the proper way of emptying hte array??

    Example...

    $a[0] = "test1"; $a[1] = "test2"; $a[2] = "test3"; $a[3] = "test4";

    $a = ""; <-- Is this hte proper way to do it????

    I would like the array to be cleared before being it get to be use over and over....

    Thanks...

    attached mail follows:


    Got an email... The answer to this question is ...

    --clip-- $a = array();

    --clip--

    "Scott Fletcher" <scottabcoa.com> wrote in message news:20030114204648.77860.qmailpb1.pair.com... > How to do the proper way of emptying hte array?? > > Example... > > $a[0] = "test1"; > $a[1] = "test2"; > $a[2] = "test3"; > $a[3] = "test4"; > > $a = ""; <-- Is this hte proper way to do it???? > > I would like the array to be cleared before being it get to be use over and > over.... > > Thanks... > >

    attached mail follows:


    on 15/01/03 7:52 AM, Scott Fletcher (scottabcoa.com) wrote:

    > How to do the proper way of emptying hte array?? > > Example... > > $a[0] = "test1"; > $a[1] = "test2"; > $a[2] = "test3"; > $a[3] = "test4"; > > $a = ""; <-- Is this hte proper way to do it????

    unset($a);

    http://php.net/unset

    Justin

    attached mail follows:


    Hi,

    I have a PHP file that displays a form and submits for processing. The processing script redirects to a results page. I am using formmail.php to process.

    In my PHP page, the FORM line reads as: echo '<form method="POST" name="accountedit" action="..\phpscript\general\formmail.php">' . "\n";

    When I try in I.E., it works fine.

    When I try in Netscape 7, I get a page not found error. Looking at Netscape's address bar, it says: http://www.lclnav.com/staging_area/login/..%5Cphpscript%5Cgeneral%5Cformmail.php

    Why is it encoding my URL???

    Thanks, Don

    ---
    Outgoing mail is certified Virus Free.
    Checked by AVG anti-virus system (http://www.grisoft.com).
    Version: 6.0.443 / Virus Database: 248 - Release Date: 1/10/2003
    

    attached mail follows:


    Message-ID: <20030114212410.34166.qmailweb14302.mail.yahoo.com> Date: Tue, 14 Jan 2003 13:24:10 -0800 (PST) From: Chris Shiflett <shiflettphp.net> Reply-To: shiflettphp.net To: Don <donprolclcan.com>, php list <php-generallists.php.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [PHP] Why is my URL encoding itself?

    --- Don <donprolclcan.com> wrote: > In my PHP page, the FORM line reads as: > echo '<form method="POST" name="accountedit" > action="..\phpscript\general\formmail.php">' . "\n"; > > When I try in I.E., it works fine. > > When I try in Netscape 7, I get a page not found error.

    This is something I refer to as Windowsitis. URLs use slashes, not backslashes:

    action="../phpscript/general/formmail.php"

    Chris

    attached mail follows:


    ----- Original Message ----- From: "Chris Shiflett" <shiflettphp.net> To: "Don" <donprolclcan.com>; "php list" <php-generallists.php.net> Sent: Tuesday, January 14, 2003 4:24 PM Subject: Re: [PHP] Why is my URL encoding itself?

    > --- Don <donprolclcan.com> wrote: > > In my PHP page, the FORM line reads as: > > echo '<form method="POST" name="accountedit" > > action="..\phpscript\general\formmail.php">' . "\n"; > > > > When I try in I.E., it works fine. > > > > When I try in Netscape 7, I get a page not found error. > > This is something I refer to as Windowsitis. URLs use > slashes, not backslashes: > > action="../phpscript/general/formmail.php" > > Chris

    Yup. That was it.

    My bad; I should have caught that.

    Thanks, Don

    ---
    Outgoing mail is certified Virus Free.
    Checked by AVG anti-virus system (http://www.grisoft.com).
    Version: 6.0.