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: Thu Sep 26 2002 - 22:32:13 CDT

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

    php-general Digest 27 Sep 2002 03:32:13 -0000 Issue 1609

    Topics (messages 117729 through 117808):

    Re: Tar Files and send back to browser
            117729 by: Sascha Braun

    Re: local resource variables
            117730 by: Tim Ward

    Getting started with PHP
            117731 by: Sauron
            117732 by: Steve Bradwell
            117733 by: Adam Williams
            117740 by: Support . Fourthrealm.com
            117807 by: Justin French

    Re: Looking for a forum
            117734 by: Sear, Mick
            117745 by: Peter J. Schoenster

    Encrypted MySQL passwords
            117735 by: Richard Fox
            117749 by: John Holmes
            117750 by: Adam Voigt
            117770 by: Brad Bonkoski
            117784 by: Rodolfo Gonzalez
            117789 by: John Holmes

    remote files to servers
            117736 by: Simon Angell
            117738 by: ed.home.homes2see.com
            117743 by: David Buerer

    Parsing RDF files help needed?
            117737 by: Rus Foster

    hello everybody - date problem -
            117739 by: Christoph Siefer
            117742 by: Ford, Mike [LSS]

    Re: Who is online script example
            117741 by: Sear, Mick

    Re: PHP POST arrar is dropping 4 characters - Bug Info
            117744 by: David Busby

    mobile number
            117746 by: Ryan A
            117748 by: Ryan A
            117801 by: Justin French

    Re: Finding out when a Web page has changed
            117747 by: John Holmes

    LocalHost won't show PHP files
            117751 by: Serbinski, Theodore S

    Looking for some help on web header coding.
            117752 by: Joshua Patterson
            117757 by: David Buerer
            117758 by: Peter J. Schoenster
            117759 by: Joshua Patterson
            117795 by: Joshua Patterson

    Re: Owner
            117753 by: Paul Roberts

    Taking a Snapshot of Memory Usage
            117754 by: Robert James Kaes

    Displaying full array contents
            117755 by: Brad Harriger
            117756 by: Martin W Jørgensen
            117763 by: debbie_dyer
            117767 by: Brad Harriger
            117769 by: debbie_dyer
            117773 by: Martin W Jørgensen
            117776 by: debbie_dyer
            117800 by: Joshua Patterson
            117802 by: Justin French

    Session
            117760 by: Bill Farrell
            117771 by: debbie_dyer
            117804 by: Justin French

    Relative Paths and file_exists() - Solaris
            117761 by: James Nikolich

    wrong date
            117762 by: Rodrigo Meurer

    Echoing HTML in PHP as CGI
            117764 by: Reuben D. Budiardja
            117765 by: John Holmes
            117766 by: Martin W Jørgensen
            117796 by: Reuben D. Budiardja

    Simple directory listing
            117768 by: ed.home.homes2see.com
            117772 by: Kevin Stone
            117805 by: Justin French

    mySQL question
            117774 by: drparker

    REMOTE ADDR
            117775 by: Anderson O Muniz
            117777 by: Jesse Cablek
            117778 by: Anderson O Muniz
            117790 by: John Holmes

    I don't want multiple form submitted
            117779 by: Clemson Chan
            117780 by: David Buerer
            117791 by: John Holmes
            117792 by: Bob Irwin
            117806 by: Justin French

    Keeping your published script safe?
            117781 by: Stephen Craton
            117782 by: David Buerer
            117787 by: Stephen Craton
            117788 by: Smith, Benjamin
            117794 by: Stephen Craton

    Searchengine
            117783 by: Sascha Braun
            117785 by: jacob.keystreams.com

    Update involving a list field
            117786 by: Shiloh Madsen

    Re: Discovering what values start and finish x% of the records
            117793 by: Julio Nobrega

    New Question...tables
            117797 by: Shiloh Madsen
            117803 by: Tom Rogers

    Help with Regular Expressions
            117798 by: Daren Cotter
            117799 by: John Holmes

    length function
            117808 by: Jeff Bluemel

    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:


    IT'S WORKING, GOOD DAMN, IT'S WORKING!

    Yo, this was a really hard Job, if I look at the working snipped below!

    <?
    Header('Content-Type: application/x-tar');
    Header("Content-disposition: filename=".$_REQUEST['name'].".tar");
    $dir = explode("/", $_REQUEST['image']);
    chdir('../images/'.$dir['0']."/".$dir['1']."/".$dir['2']."/");
    $command = 'tar -cf - '.$_REQUEST['name'].'.jpg';
    passthru($command);
    ?>

    Ey man, this was the second Time you helped me out,

    Thanks alot. You are really a great PHP Guru I believe.

    So, if my page is finished you will be one of the first Persons
    to watch it.

    I'm really glad, that you are such an helpfull guy.

    So, stay helpfull! - Untill next time.

    Thanks really a lot!

    Sascha

    > Sascha Braun wrote:
    > > Do you know how to exclude the path informations in the tar archive?
    >
    > Yes, first chdir to the ../images directory
    > http://www.php.net/getcwd
    > http://www.php.net/chdir
    >
    > Grtz Erwin
    >
    > --
    > PHP General Mailing List (http://www.php.net/)
    > To unsubscribe, visit: http://www.php.net/unsub.php
    >

    attached mail follows:


    to test this try returning $result from the function
    e.g.
    function test()
    {
       $result = mysql_query("SELECT * FROM bigbigtable");
       return $result;
    }
    echo(mysql_numrows(test()))

    remember $result holds a number that is a pointer to the result set
    resource, it isn't the actual result data set, if the memory hasn't been
    freed you should still be able to get to it ... I think

    Tim
    www.chessish.com

    > -----Original Message-----
    > From: lallous [mailto:phplistlgwm.org]
    > Sent: 26 September 2002 11:20
    > To: php-generallists.php.net
    > Subject: local resource variables
    >
    >
    > Hello,
    >
    >
    > I was wondering if i do:
    >
    > function test()
    > {
    > $result = mysql_query("SELECT * FROM bigbigtable");
    > }
    >
    > after calling test() will $result be freed as if calling
    > mysql_free_result()?
    >
    >
    > Elias
    >
    >
    >

    attached mail follows:


    Hi all

    I am brand new to PHP, I have a friend that develops in it and I'm
    interested in learning more about it. I am familiar with VB at the moment
    and that's about it, but I'm always willing to learn!!

    What do I need to get developing using PHP? I want to develop completely on
    my machine rather than upload files to a web server. I have W2K installed.

    Any help is much appreciated,

    Regards,

    Steve.

    attached mail follows:


    Welcome Steve,

    You'll need to do two things to get started, download apache and php for
    windows, and configure 2 files - httpd.conf (apache), and php.ini. A good
    tutorial can be found here :

    http://softwaredev.earthweb.com/script/article/0,,12014_912381,00.html

    After that create a .php file in apache's /htdocs dir (which is where you
    will put your pages), the file should look like this:

    <?
    phpinfo();
    ?>

    This will show you all of php's configuration settings.

    From there the world is your oyster ;)

    HTH,
    Steve.

    -----Original Message-----
    From: Sauron [mailto:steveacenturion-ms.co.uk]
    Sent: Wednesday, September 25, 2002 12:53 PM
    To: php-generallists.php.net
    Subject: [PHP] Getting started with PHP

    Hi all

    I am brand new to PHP, I have a friend that develops in it and I'm
    interested in learning more about it. I am familiar with VB at the moment
    and that's about it, but I'm always willing to learn!!

    What do I need to get developing using PHP? I want to develop completely on
    my machine rather than upload files to a web server. I have W2K installed.

    Any help is much appreciated,

    Regards,

    Steve.

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

    attached mail follows:


    read the install section of the PHP manual at www.php.net and then read the tutorial.

    Adam

    On Wed, 25 Sep 2002, Sauron wrote:

    > Hi all > > I am brand new to PHP, I have a friend that develops in it and I'm > interested in learning more about it. I am familiar with VB at the moment > and that's about it, but I'm always willing to learn!! > > What do I need to get developing using PHP? I want to develop completely on > my machine rather than upload files to a web server. I have W2K installed. > > Any help is much appreciated, > > Regards, > > Steve. > > > > >

    attached mail follows:


    Sauron, Since you're running Win2K, then you can use IIS already installed instead of Apache. I use Win2K Server, with IIS, PHP 4, and mySQL on my local box, and it works just fine.

    Peter

    At 10:55 AM 9/26/2002 -0400, Steve Bradwell wrote: >Welcome Steve, > >You'll need to do two things to get started, download apache and php for >windows, and configure 2 files - httpd.conf (apache), and php.ini. A good >tutorial can be found here : > >http://softwaredev.earthweb.com/script/article/0,,12014_912381,00.html > >After that create a .php file in apache's /htdocs dir (which is where you >will put your pages), the file should look like this: > ><? >phpinfo(); >?> > >This will show you all of php's configuration settings. > > From there the world is your oyster ;) > >HTH, >Steve. > >-----Original Message----- >From: Sauron [mailto:steveacenturion-ms.co.uk] >Sent: Wednesday, September 25, 2002 12:53 PM >To: php-generallists.php.net >Subject: [PHP] Getting started with PHP > > >Hi all > >I am brand new to PHP, I have a friend that develops in it and I'm >interested in learning more about it. I am familiar with VB at the moment >and that's about it, but I'm always willing to learn!! > >What do I need to get developing using PHP? I want to develop completely on >my machine rather than upload files to a web server. I have W2K installed. > >Any help is much appreciated, > >Regards, > >Steve. > > > > >-- >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

    - - - - - - - - - - - - - - - - - - - - - Fourth Realm Solutions pbechardfourthrealm.com http://www.fourthrealm.com Tel: 519-739-1652 - - - - - - - - - - - - - - - - - - - - -

    attached mail follows:


    Install Apache, PHP and MySQL.

    See each site for more information (http://php.net/install, apache.org, mysql.com), and I'd advise using pre-compiled installer scripts, rather than compiling your own for the moment... all of the above are free.

    stick with all the default settings, and figure out what else you want later.

    Justin

    on 26/09/02 2:53 AM, Sauron (steveacenturion-ms.co.uk) wrote:

    > Hi all > > I am brand new to PHP, I have a friend that develops in it and I'm > interested in learning more about it. I am familiar with VB at the moment > and that's about it, but I'm always willing to learn!! > > What do I need to get developing using PHP? I want to develop completely on > my machine rather than upload files to a web server. I have W2K installed. > > Any help is much appreciated, > > Regards, > > Steve. > > >

    attached mail follows:


    I went through a load of forum systems recently that I found on www.hotscripts.com, but none of them had what I wanted - In the end, I used the bare-bones forum system in 'PHP & MySQL Web Development' by Welling and Thomson and added:

    - My own existing login system (I was integrating forums into a larger project) - My own templating system - Separate forums - A bunch of other functions such as 'who's online', #topics, #posts, last post, last user to post, etc.

    In the end, after spending nearly 2 weeks fiddling around trying to work out why people use variables like $a, $b and $c and never comment their code, I managed to get my system running smoothly with no 'workarounds' to incorporate complex systems. I'm really happy with the end result, and I'd recommend starting from the bottom up rather than stripping out the unnecessary code from other projects.

    If you only need a forum and want a fully-featured solution, I'd recommend phpBB from those I looked at.

    Mick

    -----Original Message----- From: Paul Nicholson [mailto:pauldtnicholson.com] Sent: 26 September 2002 12:20 To: jtjohnstoncourrier.usherb.ca; John Taylor-Johnston; php-generallists.php.net Subject: Re: [PHP] Looking for a forum

    -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1

    Hey, http://www.ibforums.com/ ~Pauly

    On Thursday 26 September 2002 01:26 am, John Taylor-Johnston wrote: > Hi, > I'm looking for some forum script, a bit like this: > http://www.chevelles.com/cgi-bin/forum/Ultimate.cgi > Can anyone post a link to something useful? > John

    - -- ~Paul Nicholson Design Specialist WebPower Design "The web....the way you want it!" paulwebpowerdesign.net

    "It said uses Windows 98 or better, so I loaded Linux!" Registered Linux User #183202 using Register Linux System # 81891 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org

    iD8DBQE9ku11DyXNIUN3+UQRAvs9AJ4jGZ9X4QKEXQDhKYXBLAjTXzO/ygCcCHXw aT5wk0Z0Lc97xlqpIgQQaHs= =po2u -----END PGP SIGNATURE-----

    attached mail follows:


    On 26 Sep 2002 at 1:26, John Taylor-Johnston wrote:

    > Hi, > I'm looking for some forum script, a bit like this: > http://www.chevelles.com/cgi-bin/forum/Ultimate.cgi > Can anyone post a link to something useful?

    I know a couple of webmasters who are using and like

    http://www.phpbb.com/

    I've never used any bb systems to say one way or another. Certainly easy to install.

    Peter

    attached mail follows:


    Hi,

    I am connecting to a mysql server on a remote machine, and opened up port 3306 for this purpose. But, I am concerned about sending a clear text password, via the mysql_pconnect() call. My question is, what is the procedure for connecting to a remote server with an encrypted password? Or, does mysql_pconnect handle this?

    THX RIch

    attached mail follows:


    > I am connecting to a mysql server on a remote machine, and opened up port > 3306 for this purpose. But, I am concerned about sending a clear text > password, via the mysql_pconnect() call. My question is, what is the > procedure for connecting to a remote server with an encrypted password? > Or, does mysql_pconnect handle this?

    Nope, it's all in the clear. MySQL 4.0 has support for doing this over SSL, I think.

    ---John Holmes...

    attached mail follows:


    Maybe you could somehow setup your SSH tunnel before-hand (at server start up or something) and use that instead.

    Adam Voigt adam.voigtcryptocomm.com

    On Thu, 2002-09-26 at 12:40, John Holmes wrote: > > I am connecting to a mysql server on a remote machine, and opened up > port > > 3306 for this purpose. But, I am concerned about sending a clear text > > password, via the mysql_pconnect() call. My question is, what is the > > procedure for connecting to a remote server with an encrypted > password? > > Or, does mysql_pconnect handle this? > > Nope, it's all in the clear. MySQL 4.0 has support for doing this over > SSL, I think. > > ---John Holmes... > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    There are common one-way encryption, like md5, this is commonly what I do, I encrypt with md5 when I insert the password into my database on the DB server, and then I encrypt with PHP on the Web server side, so therefore, I am only ever sending my md5 encrypted password over the "wire". Since it is the same every time it is like doing string compares on the same encrypted value so it authenticates, of course this is also the vulnerability of md5. I suppose that with cracking software and time, someone could get it, but it also might be better then sending it in the clear.

    -Brad

    Adam Voigt wrote:

    > Maybe you could somehow setup your SSH tunnel before-hand > (at server start up or something) and use that instead. > > Adam Voigt > adam.voigtcryptocomm.com > > On Thu, 2002-09-26 at 12:40, John Holmes wrote: > > > I am connecting to a mysql server on a remote machine, and opened up > > port > > > 3306 for this purpose. But, I am concerned about sending a clear text > > > password, via the mysql_pconnect() call. My question is, what is the > > > procedure for connecting to a remote server with an encrypted > > password? > > > Or, does mysql_pconnect handle this? > > > > Nope, it's all in the clear. MySQL 4.0 has support for doing this over > > SSL, I think. > > > > ---John Holmes... > > > > > > -- > > 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:


    On Thu, 26 Sep 2002, Brad Bonkoski wrote:

    > also might be better then sending it in the clear.

    But I guess that the original poster wanted to know how to avoid the clear text session originated by the client-server dialog itself, not the passwords in a query (its easy to log the sessions using tcpdump, for example). BTW (and I have not checked the CVS/TODO, so I ask here), is there planned support for SSL & MySQL 4.x.x in PHP?.

    Thanks, Rodolfo.

    attached mail follows:


    > BTW (and I have not checked the CVS/TODO, so I ask here), is > there planned support for SSL & MySQL 4.x.x in PHP?.

    Yes. More info in Chapter 4.3.9.1 of the MySQL manual.

    ---John Holmes...

    attached mail follows:


    Hi all. i was wondering if it is possible to use PHP to retrieve a remote file and then write a copy to my own server for quicker access?

    --
    Cheers
    ---------------------------------------------------------
    Simon Angell
    Canberra ACT
    www.canberra-wx.com
    ---------------------------------------------------------
    Member of:
    Australian Severe Weather Association.
    www.severeweather.asn.au
    ---------------------------------------------------------
    This email is virus free.
    Scanned before leaving my mailbox
    using Norton Antivirus 2002 for Win2k
    Scanned with the latest definition File.
    

    attached mail follows:


    While were on the subject what about retreiving a web page and images based on URL?

    Ed Curtis

    On Fri, 27 Sep 2002, Simon Angell wrote:

    > Hi all. > i was wondering if it is possible to use PHP to retrieve a remote file and > then write a copy to my own server for quicker access? > > -- > Cheers > --------------------------------------------------------- > Simon Angell > Canberra ACT > www.canberra-wx.com > --------------------------------------------------------- > Member of: > Australian Severe Weather Association. > www.severeweather.asn.au > --------------------------------------------------------- > This email is virus free. > Scanned before leaving my mailbox > using Norton Antivirus 2002 for Win2k > Scanned with the latest definition File. > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    Of Course!

    You can use the fopen functions or curl functions depending on what and how you want to manage the data once you get it.

    Look at the manual in both of these sections and it will show you how to do it.

    BTW: What you are talking about doing is building a caching webserver. Apache can do this by default, so can many other web server so check documentaiton there as well.

    David

    -----Original Message----- From: Simon Angell [mailto:seangelliprimus.com.au] Sent: Thursday, September 26, 2002 8:12 AM To: php-generallists.php.net Subject: [PHP] remote files to servers

    Hi all. i was wondering if it is possible to use PHP to retrieve a remote file and then write a copy to my own server for quicker access?

    --
    Cheers
    ---------------------------------------------------------
    Simon Angell
    Canberra ACT
    www.canberra-wx.com
    ---------------------------------------------------------
    Member of:
    Australian Severe Weather Association.
    www.severeweather.asn.au
    ---------------------------------------------------------
    This email is virus free.
    Scanned before leaving my mailbox
    using Norton Antivirus 2002 for Win2k
    Scanned with the latest definition File.
    

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

    attached mail follows:


    Hi All, I've been playing with parsing RDF/XML files using PHP (code snippet below). However I'm having trouble trying to work out how to actually format the results in an order. My source is in the form

    <item> <title>Politicizing Science</title> <link>http://slashdot.org/article.pl?sid=02/09/17/0349219> </item>

    Now I could easily cope with it if it was link, title as I would just print <a href=$link>$title</a>. However I just can't work out a way of doing this, this way. My attempt so far is below (mostly debugging code)

    function startElement($parser, $name, $attrs) { global $depth,$type,$title,$url; for ($i = 0; $i < $depth[$parser]; $i++) { print " "; } $type = $name; $depth[$parser]++; }

    function stopElement($parser, $name) { global $depth,$type,$title,$url; $depth[$parser]--; print "depth parse = $depth[$parser] and $title !! $url <br> "; }

    function characterData($parser, $data) { global $type,$title,$url; if ($data) { switch ($type) { case "ITEM": case 'LINK': $url=$data; case "TITLE": $title=$data; } } } $file="slashdot.rdf";

    $fp= fopen($file,"r");

    $parser=xml_parser_create(); xml_set_element_handler($parser,"startElement","stopElement"); xml_set_character_data_handler($parser,"characterData");

    while ($data = fread($fp,4096)) xml_parse($parser, $data, feof($fp)) or die(sprintf("XML error: %s at line %d", xml_error_string(xml_get_error_code($parser)),xml_get_current_line_number($parser)));

    fclose($fp);

    As you can see I'm trying to use global variables but I'm just really unhappy with the quality of the code so any help would be appreciated.

    Rgds

    Rus foster

    --
    http://www.fsck.me.uk - Rant wibble wave
    http://shells.fsck.me.uk - Hosting and stuff
    

    attached mail follows:


    Hi everybody out there,

    my name is Christopher (loc:germany), and i'm new in here.

    My actual pain is:

    I expecting

    <?php

    $timestamp = ($now - $five_minutes_ago); print date(H:i:s, $timestamp);

    ?>

    to print something like "00:05:00".

    The two given timstamps, differing (e.g.) five minutes, wich is 300 seconds, print this instead: "01:05:00". Whatever I try, the result always is an hour to much.

    Any 'hacks' on this ?-)

    Thanks for your time,

    Christopher

    -- 
    

    sym.net - martin butz & christoph siefer gbr zwirnerstrasse 26 - 50678 koeln - 0221/3762591 email: siefersym.net - netz: http://www.sym.net

    attached mail follows:


    > -----Original Message----- > From: Christoph Siefer [mailto:siefersym.net] > Sent: 26 September 2002 16:16 > > I expecting > > <?php > > $timestamp = ($now - $five_minutes_ago); > print date(H:i:s, $timestamp); > > ?> > > to print something like "00:05:00". > > The two given timstamps, differing (e.g.) five minutes, wich is 300 > seconds, print this instead: "01:05:00". > Whatever I try, the result always is an hour to much.

    This looks like it might be a time-zone issue, as I'd guess being in Germany you're 1 hour different from GMT. Let's see: $timestamp should contain 300, which equates to 00:05:00 01-Jan-1970 GMT -- but if you're 1 hour ahead of GMT, date will compensate for this and return 01:05:00 01-Jan-1970 in your local timezone.

    Try using gmdate instead, which does not do any timezone compensation.

    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:


    I have my own login system - which authenticates against a MySQL database and then uses sessions to keep track of logins. It registers a session variable for last access time, and logs access to pages in a separate table. Then I can do things like this:

    function currently_active_users(){ //Returns a formatted string of currently logged in (and with valid sessions) users $query = "SELECT DISTINCT user_id from log_access WHERE (UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(lastaccess)) < (30*60)";//Users accessing the site in last half an hour. $db = db_connect(); $result = mysql_query($query, $db); while ($row = mysql_fetch_array($result)) { $users_online .= $row["user_id"]; $users_online .= ", "; } //loop through and add returned users to string. $users_online = substr($users_online, 0, -2);//Ditch last comma and space. return $users_online; }

    Dunno if this is any use to you?

    Mick

    -----Original Message----- From: Research and Development [mailto:randdealante.com] Sent: 25 September 2002 23:26 To: PHP General List Subject: Who is online script example

    Hello. Has anyone noticed that some sites can display a list of users currently looking at their site? I would like to see the code to do such things.

    Thanks in advance.

    attached mail follows:


    List, Here's the bugs:

    http://bugs.php.net/bug.php?id=19460 http://bugs.php.net/bug.php?id=19554

    It's related to mbstring, Apache 2.0.40 and PHP 4.2.3 you can get the latest snapshot or you can follow instructions below

    <snip from the bug page> The issue was with the --enable-mbstr-enc-trans configure option; remove it from your configure line and rebuild and the problem goes away. This has been fixed in CVS. </snip from the bug page>

    John Holmes wrote: > This was just talked about last week, search the archives. IIRC, it was > a bug, so maybe search the buglist, too. > > ---John Holmes... > > >>-----Original Message----- >>From: David Busby [mailto:busbypnts.com] >>Sent: Wednesday, September 25, 2002 7:29 PM >>To: php-generallists.php.net >>Subject: [PHP] PHP POST arrar is dropping 4 characters >> >>List, >> I'm using PHP on my RH73 box and when I post it drops 4 > > characters > >>out of >>the post array. Can someone look at the code below and tell me if I'm >>missing something? Why would it cut four characters off? Perhaps > > cause > >>the name is four chars? Bug? >> >>TIA >>/B >> >>HTML that is sent to browser >> >><input name='ei[]' type='checkbox' >>value="24033CD9-7C60-4AB0-9D7D-180D885DC857" />Item One<br /> >><input name='ei[]' type='checkbox' >>value="8D86D6B8-A42E-4B19-B930-826AAECA2AB4" />Item Two<br /> >><input name='ei[]' type='checkbox' >>value="3D6A7538-55ED-47C9-9447-0083EE6525F5" />Item Three<br /> >><input name='ei[]' type='checkbox' >>value="9CAC5C80-AEAA-4EF3-9B96-750994A3E787" />Item Four<br /> >> >>PHP that reads the post: >> >>$ar_ei = $_POST['ei']; >>if (is_array($ar_ei)) >>{ >> $c = sizeof($ar_ei); >> for ($i=0;$i<$c;$i++) >> { >> // Right here is where the first four characters are cut off > > from > >> // the 'ei[]' value, should be >> // "24033CD9-7C60-4AB0-9D7D-180D885DC857" but instead is >> // "3CD9-7C60-4AB0-9D7D-180D885DC857" >> echo $ar_ei[$i]."<br />"; >> } >>} >> >> >>-- >>PHP General Mailing List (http://www.php.net/) >>To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    Hi guys, I am trying to make a script which will automatically put in the first 4-5 numbers of a mobile number depending on which mobile connection the user has....but since i do not live in the states I would appreciate any help you can give me..

    To call here from outside Stockholm,Sweden(my location) the number is something like +46 7371(5 digits here) and my provider is CONVIQ

    what is the country code + first five digits and provider of your mobile number? As you can see i am not asking for your personal number, just the code and first 4 or 5 provider digits and location....also please tell me if its a prepaid card or a regular..

    If you can give me differient providers numbers I would appreciate it even more....

    Thanks in advance, -Ryan.

    attached mail follows:


    Hey,

    > It used to be that 07xxx = vodafone ... and 07yyy = orange - but now it > could be anything.

    DAMN, that sounds bad, any fixed numbers in the UK atleast? My cousins number is +44 79320----- so that could be any company right? I am not just trying to do the states, any location......trying to make it a bit workwide for a study project.....

    Cheers, -Ryan.

    > > -----Original Message----- > From: Ryan A [mailto:rjumac.com] > Sent: 26 September 2002 17:16 > To: php-generallists.php.net > Subject: [PHP] mobile number > > > Hi guys, > I am trying to make a script which will automatically put in the first 4-5 > numbers of a mobile number depending on which mobile connection the user > has....but since i do not live in the states I would appreciate any help you > can give me.. > > > To call here from outside Stockholm,Sweden(my location) the number is > something like +46 7371(5 digits here) and my provider is CONVIQ > > what is the country code + first five digits and provider of your mobile > number? > As you can see i am not asking for your personal number, just the code and > first 4 or 5 provider digits and location....also please tell me if its a > prepaid card or a regular.. > > If you can give me differient providers numbers I would appreciate it even > more.... > > Thanks in advance, > -Ryan. > > > _____________________________________________________________________ > This message has been checked for all known viruses by the > MessageLabs Virus Control Centre. > > This message has been checked for all known viruses by the MessageLabs Virus Control Centre. > > > ********************************************************************* > > Notice: This email is confidential and may contain copyright material of Ocado Limited (the "Company"). Opinions and views expressed in this message may not necessarily reflect the opinions and views of the Company. > If you are not the intended recipient, please notify us immediately and delete all copies of this message. Please note that it is your responsibility to scan this message for viruses. > > Company reg. no. 3875000. Swallowdale Lane, Hemel Hempstead HP2 7PY > > ********************************************************************* >

    attached mail follows:


    Nah, I'd advise against this... doesn't that mean that every time a new provide pops up, that you have to modify the code? And trying to keep on top of worldwide providers would be a nightmare... there are maybe 10-15 providers in Australia alone... and one of them could drop off or another could emerge any day.

    And worse still (although it's a good thing!!!), in Australia they've just passed legislation to ensure that you can carry your existing number to another provider... meaning that my Vodafone prefix of 0414 can now be a Telstra, Orange, or whatever else prefix.

    The prefix's are begining to mean nothing.

    What's wrong with the user typing their whole number?

    Justin

    on 27/09/02 2:16 AM, Ryan A (rjumac.com) wrote:

    > Hi guys, > I am trying to make a script which will automatically put in the first 4-5 > numbers of a mobile number depending on which mobile connection the user > has....but since i do not live in the states I would appreciate any help you > can give me.. > > > To call here from outside Stockholm,Sweden(my location) the number is > something like +46 7371(5 digits here) and my provider is CONVIQ > > what is the country code + first five digits and provider of your mobile > number? > As you can see i am not asking for your personal number, just the code and > first 4 or 5 provider digits and location....also please tell me if its a > prepaid card or a regular.. > > If you can give me differient providers numbers I would appreciate it even > more.... > > Thanks in advance, > -Ryan. >

    attached mail follows:


    Yeah, true. Maybe you could just ereg() out the content. Each url would need it's own ereg, though, so it won't be as easy to set up.

    But, technically, if the quote changes, then the page has been updated, even if it's dynamic. How do you define "updated"??

    ---John Holmes...

    > -----Original Message----- > From: Justin French [mailto:justinindent.com.au] > Sent: Thursday, September 26, 2002 10:25 AM > To: Marek Kilimajer; PHP > Subject: Re: [PHP] Finding out when a Web page has changed > > Same with sites that have negligible daily changes (like today's date > dynamically inserted), or random changes (a random quote, tip, stock > quote, > product, image, etc etc would all screw that up). > > Justin > > > on 26/09/02 11:03 PM, Marek Kilimajer (kilimajerwebglobe.sk) wrote: > > > Hope the sites have no banners :), they change all the time > > > > John Holmes wrote: > > > >> You could cache/save the actual contents of the file, then when you > read > >> it next time, compare it to what you saved and see if it changed. You > >> may want to filter out everything but what's between <body> and > </body>, > >> so you're not thinking it changed just b/c of something in the > >> headers... > >> > >> ---John Holmes... > >> > >> > >> > >>> -----Original Message----- > >>> From: Vikram Vaswani [mailto:vikramw-o-i.com] > >>> Sent: Thursday, September 26, 2002 7:04 AM > >>> To: php-generallists.php.net > >>> Subject: [PHP] Finding out when a Web page has changed > >>> > >>> Hi all, > >>> > >>> I need to write an application that accepts a list of URLs and checks > >>> > >>> > >> them > >> > >> > >>> on a daily basis (via cron) to see if the pages have changed in the > >>> > >>> > >> past > >> > >> > >>> day. > >>> > >>> I need some help with this. Does anyone know the most optimal way to > >>> > >>> > >> find > >> > >> > >>> out when a particular Web page has been modified? I am thinking about > >>> using > >>> the Last-Modified: HTTP header - however, all servers do not return > >>> > >>> > >> this > >> > >> > >>> header - any ideas on what the fallback should be? > >>> > >>> TIA, > >>> > >>> Vikram > >>> -- > >>> "I find your lack of faith disturbing." > >>> --Darth Vader > >>> > >>> -- > >>> 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. I've scoured the net, posted tons of forum threads, tried everything. I simply cannot get this to work, yet it should be so simple.

    I recently had our Admin guy install PHP as a CGI-binary on a Unix system. Apache 1.3.2 is also installed.

    He didn't install PHP as a Apache module because the server was never configured with axps.

    Now, I can run PHP scripts at the command line, which is great.

    However, anytime I visit our server and try to view a *.php page, it just tries to open/save the file, instead of actually displaying HTML.

    My question is, what do I have to do to enable php to run like this in Apache? Is there something I need to add to httpd.conf to get this to work? I've tried everything and nothing works. Yet in the same folder my *.cgi scripts run flawlessly.

    Please help. Appreciated.

    ted

    attached mail follows:


    I have been working to try and have flash MX use PHP to access a database but have been having issues with retrieving the post values in php.

    http://127.43.1.1/learning/checkpassword.php?password=somepassword&username= MyUserName

    <html>

    <body>

    <?php

    //store header values to internal defined values. $username = $HTTP_POST_VARS['username']; $password = $HTTP_POST_VARS['password']; //db_connect has been removed for security purposes.

    mysql_select_db("test",$db);

    $result = mysql_query("SELECT * FROM users WHERE username = $username",$db); $myrow = mysql_fetch_array($result);

    if( md5($password) == $myrow['user_password'] ) echo "1"; else echo "0";

    //Trying to get some visibility on what is actually retrieved. echo $password; echo "\n\n\n"; echo $username; echo "\n\n\n"; echo "end of the line";

    ?>

    </body>

    </html>

    ----------------------------------------------------------- Initiative is what separates a genius from the rest of the pack... ----------------------------------------------------------- This Quote has been brought to you in part by the Letter C. For C is for cookie.

    attached mail follows:


    go look at the tutorial for using php with flash to retrieve variables from a database. it's pretty self explanatory and clear in how/what to do.

    -----Original Message----- From: Joshua Patterson [mailto:Bamboozanvbell.net] Sent: Thursday, September 26, 2002 10:35 AM To: 'PHP' Subject: [PHP] Looking for some help on web header coding.

    I have been working to try and have flash MX use PHP to access a database but have been having issues with retrieving the post values in php.

    http://127.43.1.1/learning/checkpassword.php?password=somepassword&username= MyUserName

    <html>

    <body>

    <?php

    //store header values to internal defined values. $username = $HTTP_POST_VARS['username']; $password = $HTTP_POST_VARS['password']; //db_connect has been removed for security purposes.

    mysql_select_db("test",$db);

    $result = mysql_query("SELECT * FROM users WHERE username = $username",$db); $myrow = mysql_fetch_array($result);

    if( md5($password) == $myrow['user_password'] ) echo "1"; else echo "0";

    //Trying to get some visibility on what is actually retrieved. echo $password; echo "\n\n\n"; echo $username; echo "\n\n\n"; echo "end of the line";

    ?>

    </body>

    </html>

    ----------------------------------------------------------- Initiative is what separates a genius from the rest of the pack... ----------------------------------------------------------- This Quote has been brought to you in part by the Letter C. For C is for cookie.

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

    attached mail follows:


    On 26 Sep 2002 at 10:35, Joshua Patterson wrote:

    > I have been working to try and have flash MX use PHP to access a > database but have been having issues with retrieving the post values in > php.

    > http://127.43.1.1/learning/checkpassword.php?password=somepassword&usern > am e= MyUserName

    > //store header values to internal defined values. > $username = $HTTP_POST_VARS['username']; > $password = $HTTP_POST_VARS['password']; > //db_connect has been removed for security purposes.

    You are using a GET, not a POST. I've never worried about this stuff. I started with Perl and using the CGI.pm library I just was given the input in a hash .. left details up to CGI.pm and I got the input no matter how it was given. I use the following in PHP

    function &ProcessFormData(&$GLOBAL_INPUT) { $FormVariables = array(); $input = $GLOBAL_INPUT['HTTP_GET_VARS'] ? $GLOBAL_INPUT['HTTP_GET_VARS'] : $GLOBAL_INPUT['HTTP_POST_VARS']; foreach($input as $Key=>$Value) { if(is_array($Value)) { foreach($Value as $SubKey=>$SubValue) { $FormVariables[$Key][$SubKey] = htmlspecialchars($SubValue); } }else { $FormVariables[$Key] = htmlspecialchars($Value); } } return $FormVariables; } # End ProcessFormData

    You might not want to use htmlspecialchars.

    Also, when I do use globals (and I hate to do that) I stick them in a global array that gets passed around. I don't use global Yaddda ....(only very rarely). Have you ever worked on someone else's code which has over 50 scattered files and no documentation and you need to find out where in the heck a variable is intialiazed and modified (can be anywhere)? Is there an easy way to handle this? Drives me nuts :) Maybe I've just not recognized the nutcracker.

    Peter

    attached mail follows:


    Thank you for your help it seems that Macromedia in there support document is a little confused about php or I need a new brain. (points to option number 2) the Macromedia document can be found at http://www.macromedia.com/desdev/mx/flash/articles/flashmx_php02.html

    ----------------------------------------------------------- Anger is only one letter short of danger. ----------------------------------------------------------- This Quote has been brought to you in part by the Letter C. For C is for cookie.

    ----- Original Message ----- From: "Peter J. Schoenster" <peterschoenster.com> To: "'PHP'" <php-generallists.php.net> Cc: <Bamboozanvbell.net> Sent: Thursday, September 26, 2002 11:31 AM Subject: Re: [PHP] Looking for some help on web header coding.

    > On 26 Sep 2002 at 10:35, Joshua Patterson wrote: > > > I have been working to try and have flash MX use PHP to access a > > database but have been having issues with retrieving the post values in > > php. > > > http://127.43.1.1/learning/checkpassword.php?password=somepassword&usern > > am e= MyUserName > > > //store header values to internal defined values. > > $username = $HTTP_POST_VARS['username']; > > $password = $HTTP_POST_VARS['password']; > > //db_connect has been removed for security purposes. > > You are using a GET, not a POST. I've never worried about this stuff. I > started with Perl and using the CGI.pm library I just was given the > input in a hash .. left details up to CGI.pm and I got the input no > matter how it was given. I use the following in PHP > > function &ProcessFormData(&$GLOBAL_INPUT) { > $FormVariables = array(); > $input = $GLOBAL_INPUT['HTTP_GET_VARS'] ? > $GLOBAL_INPUT['HTTP_GET_VARS'] : $GLOBAL_INPUT['HTTP_POST_VARS']; > foreach($input as $Key=>$Value) { > if(is_array($Value)) { > foreach($Value as $SubKey=>$SubValue) { > $FormVariables[$Key][$SubKey] = > htmlspecialchars($SubValue); > } > }else { > $FormVariables[$Key] = htmlspecialchars($Value); > } > } > return $FormVariables; > > } # End ProcessFormData > > > You might not want to use htmlspecialchars. > > Also, when I do use globals (and I hate to do that) I stick them in a > global array that gets passed around. I don't use global Yaddda > ....(only very rarely). Have you ever worked on someone else's code > which has over 50 scattered files and no documentation and you need to > find out where in the heck a variable is intialiazed and modified (can > be anywhere)? Is there an easy way to handle this? Drives me nuts :) > Maybe I've just not recognized the nutcracker. > > Peter > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    I did. That is how I came a crossed the $HTTP_POST_VARS['username']; in my code. ( The tutorial for Flash MX to php can be found at http://www.macromedia.com/desdev/mx/flash/articles/flashmx_php02.html ). If you look at my code and their code sample you will see that I have not made many changes from their sample and the only one truly is storing the vars to a internal variable instead of using it directly in the sql script. I have gotten it working by changing POST to GET as is used in Peter's sample but I have to wonder if I am still missing something as I am unable to find any documentation on this at http://php.org I came here.

    ----------------------------------------------------------- Women and cats will do as they please and men and dogs should relax and just get used to the idea. ----------------------------------------------------------- This Quote has been brought to you in part by the Letter C. For C is for cookie.

    ----- Original Message ----- From: "David Buerer" <davidpladesigns.com> To: <php-generallists.php.net> Sent: Thursday, September 26, 2002 10:42 AM Subject: RE: [PHP] Looking for some help on web header coding.

    > go look at the tutorial for using php with flash to retrieve variables from > a database. it's pretty self explanatory and clear in how/what to do. > > -----Original Message----- > From: Joshua Patterson [mailto:Bamboozanvbell.net] > Sent: Thursday, September 26, 2002 10:35 AM > To: 'PHP' > Subject: [PHP] Looking for some help on web header coding. > > > I have been working to try and have flash MX use PHP to access a database > but have been having issues with retrieving the post values in php. > > http://127.43.1.1/learning/checkpassword.php?password=somepassword&username= > MyUserName > > <html> > > <body> > > <?php > > > //store header values to internal defined values. > $username = $HTTP_POST_VARS['username']; > $password = $HTTP_POST_VARS['password']; > //db_connect has been removed for security purposes. > > mysql_select_db("test",$db); > > $result = mysql_query("SELECT * FROM users WHERE username = > $username",$db); > $myrow = mysql_fetch_array($result); > > if( md5($password) == $myrow['user_password'] ) > echo "1"; > else > echo "0"; > > //Trying to get some visibility on what is actually retrieved. > echo $password; > echo "\n\n\n"; > echo $username; > echo "\n\n\n"; > echo "end of the line"; > > > ?> > > > > </body> > > > > </html> > > ----------------------------------------------------------- > Initiative is what separates a genius from the rest of the pack... > ----------------------------------------------------------- > This Quote has been brought to you in part by the Letter C. > For C is for cookie. > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

    attached mail follows:


    the list as replies asking you to confirm your email before allowing the post, this was brought in to stop people spamming the lists.

    so to post you need a subscribed email or a confirmed email.

    Paul Roberts ++++++++++++++++++++++++ ----- Original Message ----- From: "Justin French" <justinindent.com.au> To: <jtjohnstoncourrier.usherb.ca>; <php-generallists.php.net> Sent: Thursday, September 26, 2002 1:22 PM Subject: Re: [PHP] Owner

    Why can't you post to the newsgroup with foobah.com????

    (not that i've tried)

    Justin

    on 26/09/02 4:38 PM, John Taylor-Johnston (taylorjocollegesherbrooke.qc.ca) wrote:

    > Justin, > >> Best advice is to post strictly to the newsgroup with a dud email address, > > Unfortunately, that doesn't work. I had a hotmail address, but not acceptable. > Someone did not put it on the "accepted' list. Someone back there needs to > accept that address to allow that poster to post when using > news://news.php.net/php.general. Been through that. That's what I want to do > now. Who is he? I would like to work something out with him. > >> filter out anything to that address which doesn't have [PHP] in the subject > > I've been filtering :) > >> Using 'nospam' in your address' prolly doesn't help as much as it used to, > > True, But I could work around that too, when I talk with the chap in charge :) > >> Fun huh? > > Giggle loads :p > > Thanks, > John > >

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

    attached mail follows:


    Hi, Is there any way of taking a snapshot of the current memory usage of a script? I tried the getrusage() function, but the PHP version doesn't seem to support all the options of the systems getrusage() system call.

    What I would like to do is take a snapshot of the memory usage before and after I make a call to a function, or create an object, so that I have an idea of where memory is being used by the script. Is this even possible under PHP?

    Any insight you can provide would be appreciated. -- Robert

    -- 
      ------------------------------------------------------------------
        Robert James Kaes    ---  Flarenet Inc.  ---    (519) 426-3782
    		       http://www.flarenet.com/
          * Putting the Service Back in Internet Service Provider *
      ------------------------------------------------------------------
    

    attached mail follows:


    I'm trying to write a function that will display the full contents of an array. If one of the keys contains a value that is an array, the full array (all indices) should be shown.

    As an example, given the following definitions:

    $Arr1[1] = "Apple"; $Arr1[2] = "Banana"; $Arr1[3] = $Arr2[]; $Arr2[1] = "Carrot"; $Arr2[2] = $Arr3[]; $Arr3[1] = "Orange"; $Arr3[2] = "Peach";

    the output should be:

    Arr1:1:Apple Arr1:2:Banana Arr1:3:Arr2[] Arr1:3:Arr2:1:Carrot Arr1:3:Arr2:2:Arr3[] Arr1:3:Arr2:2:Arr3:1:Orange Arr1:3:Arr2:2:Arr3:2:Peach

    The closest I've come is:

    while (current($myArr)) { if(is_array(current($myArr))) { $arrKey = key(current($myArr)); echo "Array "; echo "&nbsp=&nbsp"; $baseArray = key($myArr); echo key($myArr); echo "<BR>\n"; walkArray(current($myArr)); } else { $arrKey = key($myArr); if ($baseArray != "") { echo $baseArray; echo ":"; } echo $arrKey; echo "&nbsp=&nbsp"; echo current($myArr); echo "<BR>\n"; } next($myArr); }

    This code only echoes one dimension of a multi-dimension array. I can't find a way to reliably store more than that. Any suggestions?

    Thanks in advance,

    Brad

    attached mail follows:


    Yes. my idea is to use: echo "<pre>"; print_r($array); echo "</pre>";

    "Brad Harriger" <bradharrigerclarionhospital.org> wrote in message news:3D9348DF.3050408clarionhospital.org... > I'm trying to write a function that will display the full contents of an > array. If one of the keys contains a value that is an array, the full > array (all indices) should be shown. > > As an example, given the following definitions: > > $Arr1[1] = "Apple"; > $Arr1[2] = "Banana"; > $Arr1[3] = $Arr2[]; > $Arr2[1] = "Carrot"; > $Arr2[2] = $Arr3[]; > $Arr3[1] = "Orange"; > $Arr3[2] = "Peach"; > > > the output should be: > > Arr1:1:Apple > Arr1:2:Banana > Arr1:3:Arr2[] > Arr1:3:Arr2:1:Carrot > Arr1:3:Arr2:2:Arr3[] > Arr1:3:Arr2:2:Arr3:1:Orange > Arr1:3:Arr2:2:Arr3:2:Peach > > The closest I've come is: > > while (current($myArr)) > { > if(is_array(current($myArr))) > { > $arrKey = key(current($myArr)); > echo "Array "; > echo "&nbsp=&nbsp"; > $baseArray = key($myArr); > echo key($myArr); > echo "<BR>\n"; > walkArray(current($myArr)); > } > else > { > $arrKey = key($myArr); > if ($baseArray != "") > { > echo $baseArray; > echo ":"; > } > echo $arrKey; > echo "&nbsp=&nbsp"; > echo current($myArr); > echo "<BR>\n"; > } > next($myArr); > } > > This code only echoes one dimension of a multi-dimension array. I can't > find a way to reliably store more than that. Any suggestions? > > Thanks in advance, > > Brad >

    attached mail follows:


    You could use recursion example:-

    function printArray($arr) { for ($i =0; $i < count($arr); $i++) { if (!is_array($arr[$i])) { echo $arr[$i]; } else { printArray($arr[$i]); } } } $arr = array("Orange", "Peach", "Apple"); $arr2 = array("Banana", $arr, "Pear"); $arr3 = array($arr, $arr2);

    printArray($arr3);

    Debbie

    ----- Original Message ----- From: "Brad Harriger" <bradharrigerclarionhospital.org> To: <php-generallists.php.net> Sent: Thursday, September 26, 2002 6:50 PM Subject: [PHP] Displaying full array contents

    > I'm trying to write a function that will display the full contents of an > array. If one of the keys contains a value that is an array, the full > array (all indices) should be shown. > > As an example, given the following definitions: > > $Arr1[1] = "Apple"; > $Arr1[2] = "Banana"; > $Arr1[3] = $Arr2[]; > $Arr2[1] = "Carrot"; > $Arr2[2] = $Arr3[]; > $Arr3[1] = "Orange"; > $Arr3[2] = "Peach"; > > > the output should be: > > Arr1:1:Apple > Arr1:2:Banana > Arr1:3:Arr2[] > Arr1:3:Arr2:1:Carrot > Arr1:3:Arr2:2:Arr3[] > Arr1:3:Arr2:2:Arr3:1:Orange > Arr1:3:Arr2:2:Arr3:2:Peach > > The closest I've come is: > > while (current($myArr)) > { > if(is_array(current($myArr))) > { > $arrKey = key(current($myArr)); > echo "Array "; > echo "&nbsp=&nbsp"; > $baseArray = key($myArr); > echo key($myArr); > echo "<BR>\n"; > walkArray(current($myArr)); > } > else > { > $arrKey = key($myArr); > if ($baseArray != "") > { > echo $baseArray; > echo ":"; > } > echo $arrKey; > echo "&nbsp=&nbsp"; > echo current($myArr); > echo "<BR>\n"; > } > next($myArr); > } > > This code only echoes one dimension of a multi-dimension array. I can't > find a way to reliably store more than that. Any suggestions? > > Thanks in advance, > > Brad > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    Debbie,

    Yes. I could use recursion, but what's really hanging me up is keeping track of how deep into an array I am. It should be fairly simple, but I seem to be having a brain freeze.

    Brad

    Debbie_dyer wrote:

    > You could use recursion example:- > > function printArray($arr) { > for ($i =0; $i < count($arr); $i++) { > if (!is_array($arr[$i])) { > echo $arr[$i]; > } > else { > printArray($arr[$i]); > } > } > } > > $arr = array("Orange", "Peach", "Apple"); > $arr2 = array("Banana", $arr, "Pear"); > $arr3 = array($arr, $arr2); > > printArray($arr3); > > Debbie > > ----- Original Message ----- > From: "Brad Harriger" <bradharrigerclarionhospital.org> > To: <php-generallists.php.net> > Sent: Thursday, September 26, 2002 6:50 PM > Subject: [PHP] Displaying full array contents > > > >>I'm trying to write a function that will display the full contents of an >>array. If one of the keys contains a value that is an array, the full >>array (all indices) should be shown. >> >>As an example, given the following definitions: >> >>$Arr1[1] = "Apple"; >>$Arr1[2] = "Banana"; >>$Arr1[3] = $Arr2[]; >>$Arr2[1] = "Carrot"; >>$Arr2[2] = $Arr3[]; >>$Arr3[1] = "Orange"; >>$Arr3[2] = "Peach"; >> >> >>the output should be: >> >>Arr1:1:Apple >>Arr1:2:Banana >>Arr1:3:Arr2[] >>Arr1:3:Arr2:1:Carrot >>Arr1:3:Arr2:2:Arr3[] >>Arr1:3:Arr2:2:Arr3:1:Orange >>Arr1:3:Arr2:2:Arr3:2:Peach >> >>The closest I've come is: >> >> while (current($myArr)) >> { >> if(is_array(current($myArr))) >> { >> $arrKey = key(current($myArr)); >> echo "Array "; >> echo "&nbsp=&nbsp"; >> $baseArray = key($myArr); >> echo key($myArr); >> echo "<BR>\n"; >> walkArray(current($myArr)); >> } >> else >> { >> $arrKey = key($myArr); >> if ($baseArray != "") >> { >> echo $baseArray; >> echo ":"; >> } >> echo $arrKey; >> echo "&nbsp=&nbsp"; >> echo current($myArr); >> echo "<BR>\n"; >> } >> next($myArr); >> } >> >>This code only echoes one dimension of a multi-dimension array. I can't >>find a way to reliably store more than that. Any suggestions? >> >>Thanks in advance, >> >>Brad >> >> >>-- >>PHP General Mailing List (http://www.php.net/) >>To unsubscribe, visit: http://www.php.net/unsub.php >> >> >

    attached mail follows:


    Use a static variable in the function? A static var retains its value between function calls

    function printArray($arr) { static $depth = 0; for ($i =0; $i < count($arr); $i++) { if (!is_array($arr[$i])) { echo "$depth $arr[$i]"; } else { $depth++; printArray($arr[$i]); $depth--; } } }

    $arr = array("Orange", "Peach", "Apple"); $arr2 = array("Banana", $arr, "Pear"); $arr3 = array($arr, $arr2);

    printArray($arr3);

    Debbie

    ----- Original Message ----- From: "Brad Harriger" <bradharrigerclarionhospital.org> To: <php-generallists.php.net> Sent: Thursday, September 26, 2002 8:46 PM Subject: Re: [PHP] Displaying full array contents

    > Debbie, > > Yes. I could use recursion, but what's really hanging me up is keeping > track of how deep into an array I am. It should be fairly simple, but I > seem to be having a brain freeze. > > Brad > > > > Debbie_dyer wrote: > > > You could use recursion example:- > > > > function printArray($arr) { > > for ($i =0; $i < count($arr); $i++) { > > if (!is_array($arr[$i])) { > > echo $arr[$i]; > > } > > else { > > printArray($arr[$i]); > > } > > } > > } > > > > $arr = array("Orange", "Peach", "Apple"); > > $arr2 = array("Banana", $arr, "Pear"); > > $arr3 = array($arr, $arr2); > > > > printArray($arr3); > > > > Debbie > > > > ----- Original Message ----- > > From: "Brad Harriger" <bradharrigerclarionhospital.org> > > To: <php-generallists.php.net> > > Sent: Thursday, September 26, 2002 6:50 PM > > Subject: [PHP] Displaying full array contents > > > > > > > >>I'm trying to write a function that will display the full contents of an > >>array. If one of the keys contains a value that is an array, the full > >>array (all indices) should be shown. > >> > >>As an example, given the following definitions: > >> > >>$Arr1[1] = "Apple"; > >>$Arr1[2] = "Banana"; > >>$Arr1[3] = $Arr2[]; > >>$Arr2[1] = "Carrot"; > >>$Arr2[2] = $Arr3[]; > >>$Arr3[1] = "Orange"; > >>$Arr3[2] = "Peach"; > >> > >> > >>the output should be: > >> > >>Arr1:1:Apple > >>Arr1:2:Banana > >>Arr1:3:Arr2[] > >>Arr1:3:Arr2:1:Carrot > >>Arr1:3:Arr2:2:Arr3[] > >>Arr1:3:Arr2:2:Arr3:1:Orange > >>Arr1:3:Arr2:2:Arr3:2:Peach > >> > >>The closest I've come is: > >> > >> while (current($myArr)) > >> { > >> if(is_array(current($myArr))) > >> { > >> $arrKey = key(current($myArr)); > >> echo "Array "; > >> echo "&nbsp=&nbsp"; > >> $baseArray = key($myArr); > >> echo key($myArr); > >> echo "<BR>\n"; > >> walkArray(current($myArr)); > >> } > >> else > >> { > >> $arrKey = key($myArr); > >> if ($baseArray != "") > >> { > >> echo $baseArray; > >> echo ":"; > >> } > >> echo $arrKey; > >> echo "&nbsp=&nbsp"; > >> echo current($myArr); > >> echo "<BR>\n"; > >> } > >> next($myArr); > >> } > >> > >>This code only echoes one dimension of a multi-dimension array. I can't > >>find a way to reliably store more than that. Any suggestions? > >> > >>Thanks in advance, > >> > >>Brad > >> > >> > >>-- > >>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:


    print_r($array); simply print out the entire array.. It cant be easier.

    "Debbie_dyer" <debbie_dyersurfanytime.co.uk> wrote in message news:01bf01c26598$1d84ec00$0100a8c0homepc... > Use a static variable in the function? A static var retains its value > between function calls > > function printArray($arr) { > static $depth = 0; > for ($i =0; $i < count($arr); $i++) { > if (!is_array($arr[$i])) { > echo "$depth $arr[$i]"; > } > else { > $depth++; > printArray($arr[$i]); > $depth--; > } > } > } > > $arr = array("Orange", "Peach", "Apple"); > $arr2 = array("Banana", $arr, "Pear"); > $arr3 = array($arr, $arr2); > > printArray($arr3); > > Debbie > > ----- Original Message ----- > From: "Brad Harriger" <bradharrigerclarionhospital.org> > To: <php-generallists.php.net> > Sent: Thursday, September 26, 2002 8:46 PM > Subject: Re: [PHP] Displaying full array contents > > > > Debbie, > > > > Yes. I could use recursion, but what's really hanging me up is keeping > > track of how deep into an array I am. It should be fairly simple, but I > > seem to be having a brain freeze. > > > > Brad > > > > > > > > Debbie_dyer wrote: > > > > > You could use recursion example:- > > > > > > function printArray($arr) { > > > for ($i =0; $i < count($arr); $i++) { > > > if (!is_array($arr[$i])) { > > > echo $arr[$i]; > > > } > > > else { > > > printArray($arr[$i]); > > > } > > > } > > > } > > > > > > $arr = array("Orange", "Peach", "Apple"); > > > $arr2 = array("Banana", $arr, "Pear"); > > > $arr3 = array($arr, $arr2); > > > > > > printArray($arr3); > > > > > > Debbie > > > > > > ----- Original Message ----- > > > From: "Brad Harriger" <bradharrigerclarionhospital.org> > > > To: <php-generallists.php.net> > > > Sent: Thursday, September 26, 2002 6:50 PM > > > Subject: [PHP] Displaying full array contents > > > > > > > > > > > >>I'm trying to write a function that will display the full contents of an > > >>array. If one of the keys contains a value that is an array, the full > > >>array (all indices) should be shown. > > >> > > >>As an example, given the following definitions: > > >> > > >>$Arr1[1] = "Apple"; > > >>$Arr1[2] = "Banana"; > > >>$Arr1[3] = $Arr2[]; > > >>$Arr2[1] = "Carrot"; > > >>$Arr2[2] = $Arr3[]; > > >>$Arr3[1] = "Orange"; > > >>$Arr3[2] = "Peach"; > > >> > > >> > > >>the output should be: > > >> > > >>Arr1:1:Apple > > >>Arr1:2:Banana > > >>Arr1:3:Arr2[] > > >>Arr1:3:Arr2:1:Carrot > > >>Arr1:3:Arr2:2:Arr3[] > > >>Arr1:3:Arr2:2:Arr3:1:Orange > > >>Arr1:3:Arr2:2:Arr3:2:Peach > > >> > > >>The closest I've come is: > > >> > > >> while (current($myArr)) > > >> { > > >> if(is_array(current($myArr))) > > >> { > > >> $arrKey = key(current($myArr)); > > >> echo "Array "; > > >> echo "&nbsp=&nbsp"; > > >> $baseArray = key($myArr); > > >> echo key($myArr); > > >> echo "<BR>\n"; > > >> walkArray(current($myArr)); > > >> } > > >> else > > >> { > > >> $arrKey = key($myArr); > > >> if ($baseArray != "") > > >> { > > >> echo $baseArray; > > >> echo ":"; > > >> } > > >> echo $arrKey; > > >> echo "&nbsp=&nbsp"; > > >> echo current($myArr); > > >> echo "<BR>\n"; > > >> } > > >> next($myArr); > > >> } > > >> > > >>This code only echoes one dimension of a multi-dimension array. I can't > > >>find a way to reliably store more than that. Any suggestions? > > >> > > >>Thanks in advance, > > >> > > >>Brad > > >> > > >> > > >>-- > > >>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:


    Easier yes and ok for debug but it doesnt look very nice on a web page does it nor does it help if you want to do something with the array elements.

    Debbie

    ----- Original Message ----- From: "Martin W Jørgensen" <powerblademail.dk> To: <php-generallists.php.net> Sent: Thursday, September 26, 2002 9:17 PM Subject: Re: [PHP] Displaying full array contents

    > print_r($array); simply print out the entire array.. > It cant be easier. > > "Debbie_dyer" <debbie_dyersurfanytime.co.uk> wrote in message > news:01bf01c26598$1d84ec00$0100a8c0homepc... > > Use a static variable in the function? A static var retains its value > > between function calls > > > > function printArray($arr) { > > static $depth = 0; > > for ($i =0; $i < count($arr); $i++) { > > if (!is_array($arr[$i])) { > > echo "$depth $arr[$i]"; > > } > > else { > > $depth++; > > printArray($arr[$i]); > > $depth--; > > } > > } > > } > > > > $arr = array("Orange", "Peach", "Apple"); > > $arr2 = array("Banana", $arr, "Pear"); > > $arr3 = array($arr, $arr2); > > > > printArray($arr3); > > > > Debbie > > > > ----- Original Message ----- > > From: "Brad Harriger" <bradharrigerclarionhospital.org> > > To: <php-generallists.php.net> > > Sent: Thursday, September 26, 2002 8:46 PM > > Subject: Re: [PHP] Displaying full array contents > > > > > > > Debbie, > > > > > > Yes. I could use recursion, but what's really hanging me up is keeping > > > track of how deep into an array I am. It should be fairly simple, but I > > > seem to be having a brain freeze. > > > > > > Brad > > > > > > > > > > > > Debbie_dyer wrote: > > > > > > > You could use recursion example:- > > > > > > > > function printArray($arr) { > > > > for ($i =0; $i < count($arr); $i++) { > > > > if (!is_array($arr[$i])) { > > > > echo $arr[$i]; > > > > } > > > > else { > > > > printArray($arr[$i]); > > > > } > > > > } > > > > } > > > > > > > > $arr = array("Orange", "Peach", "Apple"); > > > > $arr2 = array("Banana", $arr, "Pear"); > > > > $arr3 = array($arr, $arr2); > > > > > > > > printArray($arr3); > > > > > > > > Debbie > > > > > > > > ----- Original Message ----- > > > > From: "Brad Harriger" <bradharrigerclarionhospital.org> > > > > To: <php-generallists.php.net> > > > > Sent: Thursday, September 26, 2002 6:50 PM > > > > Subject: [PHP] Displaying full array contents > > > > > > > > > > > > > > > >>I'm trying to write a function that will display the full contents of > an > > > >>array. If one of the keys contains a value that is an array, the full > > > >>array (all indices) should be shown. > > > >> > > > >>As an example, given the following definitions: > > > >> > > > >>$Arr1[1] = "Apple"; > > > >>$Arr1[2] = "Banana"; > > > >>$Arr1[3] = $Arr2[]; > > > >>$Arr2[1] = "Carrot"; > > > >>$Arr2[2] = $Arr3[]; > > > >>$Arr3[1] = "Orange"; > > > >>$Arr3[2] = "Peach"; > > > >> > > > >> > > > >>the output should be: > > > >> > > > >>Arr1:1:Apple > > > >>Arr1:2:Banana > > > >>Arr1:3:Arr2[] > > > >>Arr1:3:Arr2:1:Carrot > > > >>Arr1:3:Arr2:2:Arr3[] > > > >>Arr1:3:Arr2:2:Arr3:1:Orange > > > >>Arr1:3:Arr2:2:Arr3:2:Peach > > > >> > > > >>The closest I've come is: > > > >> > > > >> while (current($myArr)) > > > >> { > > > >> if(is_array(current($myArr))) > > > >> { > > > >> $arrKey = key(current($myArr)); > > > >> echo "Array "; > > > >> echo "&nbsp=&nbsp"; > > > >> $baseArray = key($myArr); > > > >> echo key($myArr); > > > >> echo "<BR>\n"; > > > >> walkArray(current($myArr)); > > > >> } > > > >> else > > > >> { > > > >> $arrKey = key($myArr); > > > >> if ($baseArray != "") > > > >> { > > > >> echo $baseArray; > > > >> echo ":"; > > > >> } > > > >> echo $arrKey; > > > >> echo "&nbsp=&nbsp"; > > > >> echo current($myArr); > > > >> echo "<BR>\n"; > > > >> } > > > >> next($myArr); > > > >> } > > > >> > > > >>This code only echoes one dimension of a multi-dimension array. I > can't > > > >>find a way to reliably store more than that. Any suggestions? > > > >> > > > >>Thanks in advance, > > > >> > > > >>Brad > > > >> > > > >> > > > >>-- > > > >>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:


    You could always use a for loop enbeded in a while loop to walk through a linked list.

    <html> <body> <?php

    $Arr1[1] = "Apple"; $Arr1[2] = "Banana"; $Arr1[3] = &$Arr2; $Arr2[1] = "Carrot"; $Arr2[2] = &$Arr3; $Arr3[1] = "Orange"; $Arr3[2] = "Peach"; $Arr3[3] = ""; //Anything that is used to define the end of the list.

    print_r($Arr1); //used a pre-existing function. $handle = &$Arr1; while ($handle != ""){ for( $i=1; $i < sizeof($handle) ; $i++){ echo " "; echo $handle[$i];

    } $handle = $handle[sizeof($handle)]; //last value in the array contains the address of the next array. }

    ?> </body> </html> You could expand the list out as long as you have memory and this function would walk through it until it found the end. But the true questions is why would you want to when you can already dynamically change the size of arrays in php. ----------------------------------------------------------- IRS: Income Removal Service ----------------------------------------------------------- This Quote has been brought to you in part by the Letter C. For C is for cookie.

    ----- Original Message ----- From: "debbie_dyer" <debbie_dyersurfanytime.co.uk> To: <php-generallists.php.net> Sent: Thursday, September 26, 2002 1:23 PM Subject: Re: [PHP] Displaying full array contents

    Easier yes and ok for debug but it doesnt look very nice on a web page does it nor does it help if you want to do something with the array elements.

    Debbie

    ----- Original Message ----- From: "Martin W Jørgensen" <powerblademail.dk> To: <php-generallists.php.net> Sent: Thursday, September 26, 2002 9:17 PM Subject: Re: [PHP] Displaying full array contents

    > print_r($array); simply print out the entire array.. > It cant be easier. > > "Debbie_dyer" <debbie_dyersurfanytime.co.uk> wrote in message > news:01bf01c26598$1d84ec00$0100a8c0homepc... > > Use a static variable in the function? A static var retains its value > > between function calls > > > > function printArray($arr) { > > static $depth = 0; > > for ($i =0; $i < count($arr); $i++) { > > if (!is_array($arr[$i])) { > > echo "$depth $arr[$i]"; > > } > > else { > > $depth++; > > printArray($arr[$i]); > > $depth--; > > } > > } > > } > > > > $arr = array("Orange", "Peach", "Apple"); > > $arr2 = array("Banana", $arr, "Pear"); > > $arr3 = array($arr, $arr2); > > > > printArray($arr3); > > > > Debbie > > > > ----- Original Message ----- > > From: "Brad Harriger" <bradharrigerclarionhospital.org> > > To: <php-generallists.php.net> > > Sent: Thursday, September 26, 2002 8:46 PM > > Subject: Re: [PHP] Displaying full array contents > > > > > > > Debbie, > > > > > > Yes. I could use recursion, but what's really hanging me up is keeping > > > track of how deep into an array I am. It should be fairly simple, but I > > > seem to be having a brain freeze. > > > > > > Brad > > > > > > > > > > > > Debbie_dyer wrote: > > > > > > > You could use recursion example:- > > > > > > > > function printArray($arr) { > > > > for ($i =0; $i < count($arr); $i++) { > > > > if (!is_array($arr[$i])) { > > > > echo $arr[$i]; > > > > } > > > > else { > > > > printArray($arr[$i]); > > > > } > > > > } > > > > } > > > > > > > > $arr = array("Orange", "Peach", "Apple"); > > > > $arr2 = array("Banana", $arr, "Pear"); > > > > $arr3 = array($arr, $arr2); > > > > > > > > printArray($arr3); > > > > > > > > Debbie > > > > > > > > ----- Original Message ----- > > > > From: "Brad Harriger" <bradharrigerclarionhospital.org> > > > > To: <php-generallists.php.net> > > > > Sent: Thursday, September 26, 2002 6:50 PM > > > > Subject: [PHP] Displaying full array contents > > > > > > > > > > > > > > > >>I'm trying to write a function that will display the full contents of > an > > > >>array. If one of the keys contains a value that is an array, the full > > > >>array (all indices) should be shown. > > > >> > > > >>As an example, given the following definitions: > > > >> > > > >>$Arr1[1] = "Apple"; > > > >>$Arr1[2] = "Banana"; > > > >>$Arr1[3] = $Arr2[]; > > > >>$Arr2[1] = "Carrot"; > > > >>$Arr2[2] = $Arr3[]; > > > >>$Arr3[1] = "Orange"; > > > >>$Arr3[2] = "Peach"; > > > >> > > > >> > > > >>the output should be: > > > >> > > > >>Arr1:1:Apple > > > >>Arr1:2:Banana > > > >>Arr1:3:Arr2[] > > > >>Arr1:3:Arr2:1:Carrot > > > >>Arr1:3:Arr2:2:Arr3[] > > > >>Arr1:3:Arr2:2:Arr3:1:Orange > > > >>Arr1:3:Arr2:2:Arr3:2:Peach > > > >> > > > >>The closest I've come is: > > > >> > > > >> while (current($myArr)) > > > >> { > > > >> if(is_array(current($myArr))) > > > >> { > > > >> $arrKey = key(current($myArr)); > > > >> echo "Array "; > > > >> echo "&nbsp=&nbsp"; > > > >> $baseArray = key($myArr); > > > >> echo key($myArr); > > > >> echo "<BR>\n"; > > > >> walkArray(current($myArr)); > > > >> } > > > >> else > > > >> { > > > >> $arrKey = key($myArr); > > > >> if ($baseArray != "") > > > >> { > > > >> echo $baseArray; > > > >> echo ":"; > > > >> } > > > >> echo $arrKey; > > > >> echo "&nbsp=&nbsp"; > > > >> echo current($myArr); > > > >> echo "<BR>\n"; > > > >> } > > > >> next($myArr); > > > >> } > > > >> > > > >>This code only echoes one dimension of a multi-dimension array. I > can't > > > >>find a way to reliably store more than that. Any suggestions? > > > >> > > > >>Thanks in advance, > > > >> > > > >>Brad > > > >> > > > >> > > > >>-- > > > >>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:


    It's a slightly different format, but print_r($array) recursively echo the contents of an array ina readable format?

    http://php.net/print_r

    Why reinvent the wheel, unless you need that specific format.

    HTH

    Justin

    on 27/09/02 3:50 AM, Brad Harriger (bradharrigerclarionhospital.org) wrote:

    > I'm trying to write a function that will display the full contents of an > array. If one of the keys contains a value that is an array, the full > array (all indices) should be shown. > > As an example, given the following definitions: > > $Arr1[1] = "Apple"; > $Arr1[2] = "Banana"; > $Arr1[3] = $Arr2[]; > $Arr2[1] = "Carrot"; > $Arr2[2] = $Arr3[]; > $Arr3[1] = "Orange"; > $Arr3[2] = "Peach"; > > > the output should be: > > Arr1:1:Apple > Arr1:2:Banana > Arr1:3:Arr2[] > Arr1:3:Arr2:1:Carrot > Arr1:3:Arr2:2:Arr3[] > Arr1:3:Arr2:2:Arr3:1:Orange > Arr1:3:Arr2:2:Arr3:2:Peach > > The closest I've come is: > > while (current($myArr)) > { > if(is_array(current($myArr))) > { > $arrKey = key(current($myArr)); > echo "Array "; > echo "&nbsp=&nbsp"; > $baseArray = key($myArr); > echo key($myArr); > echo "<BR>\n"; > walkArray(current($myArr)); > } > else > { > $arrKey = key($myArr); > if ($baseArray != "") > { > echo $baseArray; > echo ":"; > } > echo $arrKey; > echo "&nbsp=&nbsp"; > echo current($myArr); > echo "<BR>\n"; > } > next($myArr); > } > > This code only echoes one dimension of a multi-dimension array. I can't > find a way to reliably store more than that. Any suggestions? > > Thanks in advance, > > Brad >

    attached mail follows:


    Hi all,

    Is there a really thorough tutorial on the use of session variables? Seems like there are a zillion options to choose from, lots of interdependent settings, etc, and I'm a bit confused on how to make it work.

    I try not to use session objects too much in any language as it makes the code somewhat less portable, but I did want to experiment with PHP's notion before launching off on another suite of apps. I'm starting with a simple fake hit counter that checks session to see if the counter was already dinged. It works if I turn on enable_transient_sid, but setting that drives ht://dig nuts by appending ?PHPSESSIDyaddayadda to the URL. Really makes a mess of the database :-)~~.

    Obviously, I'm missing something pretty fundamental. Any suggested reading would be appreciated (yes, I did read the PHP manual :-).

    Thanks in advance, B

    ===== Bill Farrell Multivalue and *nix Support Specialist

    Phone: (828) 667-2245 Fax: (928) 563-5189 Web: http://www.jwfarrell.com

    __________________________________________________ Do you Yahoo!? New DSL Internet Access from SBC & Yahoo! http://sbc.yahoo.com

    attached mail follows:


    PHP is automatically rewriting the URLs for the tags specified in url_rewriter.tags (php.ini) because the session cookie has not been accepted. I found it best to remove these tags and append the SID manually to the URLs that need it for when cookies are off - else SIDs can get appended where you don't want them appended.

    I think PHP's session system is really good and definitely worth learning.

    Debbie

    ----- Original Message ----- From: "Bill Farrell" <jwwfarrellyahoo.com> To: <php-generallists.php.net> Sent: Thursday, September 26, 2002 8:09 PM Subject: [PHP] Session

    > Hi all, > > Is there a really thorough tutorial on the use of > session variables? Seems like there are a zillion > options to choose from, lots of interdependent > settings, etc, and I'm a bit confused on how to make > it work. > > I try not to use session objects too much in any > language as it makes the code somewhat less portable, > but I did want to experiment with PHP's notion before > launching off on another suite of apps. I'm starting > with a simple fake hit counter that checks session to > see if the counter was already dinged. It works if I > turn on enable_transient_sid, but setting that drives > ht://dig nuts by appending ?PHPSESSIDyaddayadda to the > URL. Really makes a mess of the database :-)~~. > > Obviously, I'm missing something pretty fundamental. > Any suggested reading would be appreciated (yes, I did > read the PHP manual :-). > > Thanks in advance, > B > > > ===== > Bill Farrell > Multivalue and *nix Support Specialist > > Phone: (828) 667-2245 > Fax: (928) 563-5189 > Web: http://www.jwfarrell.com > > __________________________________________________ > Do you Yahoo!? > New DSL Internet Access from SBC & Yahoo! > http://sbc.yahoo.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    Enable_trans_sid will put a psession key in the URL of the second (i think) page of the session, as a method of ensuring state... at that point it can assess if you need to keep using the URL (no cookies) or if the session state can be maintained through cookies (no URL).

    If you turn it off, sessions will ONLY use cookies, which will clean up your URLs, but prevent some people from using the site. Tuff call.

    Personally I'd look for a way of modifying ht://dig, or write a small program to go through your database removing "PHPSESSIDyaddayadda" from the URLs, or SOMETHING.

    Maintaining state in the URL is the only fool-proof method, so my gut feeling is to make sure the SITE works first, then worry about logs, htdig and other secondary problems...

    Justin

    on 27/09/02 5:09 AM, Bill Farrell (jwwfarrellyahoo.com) wrote:

    > Hi all, > > Is there a really thorough tutorial on the use of > session variables? Seems like there are a zillion > options to choose from, lots of interdependent > settings, etc, and I'm a bit confused on how to make > it work. > > I try not to use session objects too much in any > language as it makes the code somewhat less portable, > but I did want to experiment with PHP's notion before > launching off on another suite of apps. I'm starting > with a simple fake hit counter that checks session to > see if the counter was already dinged. It works if I > turn on enable_transient_sid, but setting that drives > ht://dig nuts by appending ?PHPSESSIDyaddayadda to the > URL. Really makes a mess of the database :-)~~. > > Obviously, I'm missing something pretty fundamental. > Any suggested reading would be appreciated (yes, I did > read the PHP manual :-). > > Thanks in advance, > B > > > ===== > Bill Farrell > Multivalue and *nix Support Specialist > > Phone: (828) 667-2245 > Fax: (928) 563-5189 > Web: http://www.jwfarrell.com > > __________________________________________________ > Do you Yahoo!? > New DSL Internet Access from SBC & Yahoo! > http://sbc.yahoo.com

    attached mail follows:


    Hello; I'm using PHP 4.2.3 on a Solaris 2.8 (Sparc) system. I've been having some difficulties getting PHP-Nuke 6.0 to work for me. I eventually narrowed the problem down to incorrect results from calls to file_exists(). It seems that file_exists() is having trouble finding an existing file within a subdirectory of the current directory -- IF I use relative pathnames. If I use absolute pathnames (specifically by prepending the results of getpwd() as stored in a variable), then things work fine - but clearly this shouldn't be necessary. I've written a sample PHP script to illustrate the problem I'm having. Below it can be found the output of having executed this script. (You can see it for yourself http://wireless.pleiades.com/jim.php). As you can see, only the third test works - and that's the one with $CurrentDir prepended to the $targetfile... This is probably a "doh!" kind of problem, but it's got me stumped. Any help would be appreciated. Thanks, Jim ================================================ <?php $CurrentDir = getcwd(); echo "Current directory (saved as \$CurrentDir) is:<br>[$CurrentDir]</br>"; $targetfile = "modules/News/index.php"; echo "<br>Test 1 - Relative Pathname.<br>Looking for [$targetfile]<br>"; if ( file_exists( "$targetfile" ) ) { echo "- Found it.<br>"; } else { echo "- Not found.<br>"; } echo "<br>Test 2 - Relative Pathname with preceding './'<br>looking for [./$targetfile]<br>"; if ( file_exists( "./$targetfile" ) ) { echo "- Found it.<br>"; } else { echo "- Not found.<br>"; } echo "<br>Test 3 - Absolute Pathname (By prepending \$CurrentDir)<br>looking for [$CurrentD ir/$targetfile]<br>"; if ( file_exists( "$CurrentDir/$targetfile" ) ) { echo "- Found it.<br>"; } else { echo "- Not found.<br>"; } ?> =================================================== OUTPUT: -------------- Current directory (saved as $CurrentDir) is: [/usr/local/websites/wireless.pleiades.com/html]

    Test 1 - Relative Pathname. Looking for [modules/News/index.php] - Not found.

    Test 2 - Relative Pathname with preceding './' looking for [./modules/News/index.php] - Not found.

    Test 3 - Absolute Pathname (By prepending $CurrentDir) looking for [/usr/local/websites/wireless.pleiades.com/html/modules/News/index.php] - Found it.

    attached mail follows:


    Hi!

    Someone knows why is this returning 1969-12-31 ???

    $day = 13; $month = 10; $year = 2002; echo date("Y-m-d",mktime (0,0,0,$month,$day,$year));

    And MySQL also does the same when I insert '2002-10-13' in a date field!!!

    ::: R o d r i g o M e u r e r :::: rodrigo.meurerbase51.com.br B a s e 5 1 - W e b p r o j e c t s Tel 51 3332.8813 / Fax 51 3321.1405 : : : www.base51.com.br : : :

    attached mail follows:


    Hi all, When using Apache web server, with php module, I can intermix between HTML code and PHP. But when using PHP as CGI (in other web server, eg. OMNI), as far as I know, I have to write all HTML code using either echo or print statement, right? Is there a better way to do this?

    The problem is that someone already have the HTML part, and I just wont to insert some PHP codes around it. If I use echo " [HTML CODE] ";

    then I have to escape all the quotation mark (") inside the HTML code, which is laborious and not really elegant. The same problem occurs even if I use echo with single quote instead of double quote. I have to escape all the single quote, since the HTML code is also intermix between HTML and javascript, which has single and double quotes.

    How do I best solve this problem? Thanks a lot for any response. Reuben D. Budiardja

    attached mail follows:


    The module and CGI will work the same. Just put your PHP where you need it within the HTML.

    ---John Holmes...

    ----- Original Message ----- From: "Reuben D. Budiardja" <reubendbinnovativethought.com> To: <php-generallists.php.net> Sent: Thursday, September 26, 2002 3:27 PM Subject: [PHP] Echoing HTML in PHP as CGI

    Hi all, When using Apache web server, with php module, I can intermix between HTML code and PHP. But when using PHP as CGI (in other web server, eg. OMNI), as far as I know, I have to write all HTML code using either echo or print statement, right? Is there a better way to do this?

    The problem is that someone already have the HTML part, and I just wont to insert some PHP codes around it. If I use echo " [HTML CODE] ";

    then I have to escape all the quotation mark (") inside the HTML code, which is laborious and not really elegant. The same problem occurs even if I use echo with single quote instead of double quote. I have to escape all the single quote, since the HTML code is also intermix between HTML and javascript, which has single and double quotes.

    How do I best solve this problem? Thanks a lot for any response. Reuben D. Budiardja

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

    attached mail follows:


    You can use this code:

    print <<< EndOfHTML

    put all html in here even with "

    EndOfHTML;

    This will print out all html. and dont care about special signs.

    goodluck. Martin

    "Reuben D. Budiardja" <reubendbinnovativethought.com> wrote in message news:200209261527.15436.reubendbinnovativethought.com... Hi all, When using Apache web server, with php module, I can intermix between HTML code and PHP. But when using PHP as CGI (in other web server, eg. OMNI), as far as I know, I have to write all HTML code using either echo or print statement, right? Is there a better way to do this?

    The problem is that someone already have the HTML part, and I just wont to insert some PHP codes around it. If I use echo " [HTML CODE] ";

    then I have to escape all the quotation mark (") inside the HTML code, which is laborious and not really elegant. The same problem occurs even if I use echo with single quote instead of double quote. I have to escape all the single quote, since the HTML code is also intermix between HTML and javascript, which has single and double quotes.

    How do I best solve this problem? Thanks a lot for any response. Reuben D. Budiardja

    attached mail follows:


    Thanks. This is what i was looking for. I remember reading something about this but just didn't remember where.

    Rdb.

    On Thursday September 26 2002 03:42 pm, Martin W Jørgensen wrote: > You can use this code: > > print <<< EndOfHTML > > put all html in here even with " > > EndOfHTML; > > This will print out all html. and dont care about special signs. > > goodluck. > Martin > > "Reuben D. Budiardja" <reubendbinnovativethought.com> wrote in message > news:200209261527.15436.reubendbinnovativethought.com... > Hi all, > When using Apache web server, with php module, I can intermix between HTML > code and PHP. But when using PHP as CGI (in other web server, eg. OMNI), as > far as I know, I have to write all HTML code using either echo or print > statement, right? Is there a better way to do this? > > The problem is that someone already have the HTML part, and I just wont to > insert some PHP codes around it. If I use > echo " > [HTML CODE] "; > > then I have to escape all the quotation mark (") inside the HTML code, > which is laborious and not really elegant. The same problem occurs even if > I use echo with single quote instead of double quote. I have to escape all > the single quote, since the HTML code is also intermix between HTML and > javascript, which has single and double quotes. > > How do I best solve this problem? Thanks a lot for any response. > Reuben D. Budiardja

    attached mail follows:


    I've been hunting all over to find a script that will just list a directory. I don't need a full feature file system manager just something I can list files and choose to delete a file if I wish. Where would I find this.

    TIA,

    Ed

    attached mail follows:


    http://www.php.net/manual/en/function.opendir.php -Kevin

    ----- Original Message ----- From: <edhome.homes2see.com> To: <php-generallists.php.net> Sent: Thursday, September 26, 2002 1:58 PM Subject: [PHP] Simple directory listing

    > > I've been hunting all over to find a script that will just list a > directory. I don't need a full feature file system manager just something > I can list files and choose to delete a file if I wish. Where would I find > this. > > TIA, > > Ed > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    I'm certain you'll find something on phpclasses.org

    JF

    on 27/09/02 5:58 AM, edhome.homes2see.com (edhome.homes2see.com) wrote:

    > > I've been hunting all over to find a script that will just list a > directory. I don't need a full feature file system manager just something > I can list files and choose to delete a file if I wish. Where would I find > this. > > TIA, > > Ed > >

    attached mail follows:


    I'm just starting to use PHP with mySQL, and I have a few basic questions. I've successfully created a mySQL database on my local machine, was able to create tables and populate them (from the command line), query it with php from the browser, etc - no problems there. Now I need to create one on a remote server.

    1) Since I have access to the ftp, is that login/pass valid for the mysql database? if not, is there a location where this information (l/p to mySQL) is stored?

    2) Are there concrete files in mySQL? For example, can i create the database i want from my local machine and then upload it? where are they located? this is the most puzzling to me - i don't understand how these databases seem to exist in thin air...

    3) How do i go about getting that command line setting, the one that i use to create tables and add things and whatever on my local machine, on a remote server? do they have to have telnet enabled?

    4) what is phpmyAdmin? could this help my situation?

    any help would be greatly appreciated....

    -Doug

    attached mail follows:


    Hello,

    I need help I never programmed in php. :/

    I have a firewall with proxy. Now a put a webcam behind the firewall. If put the external_ip i see the cam, if i put the internal_ip i see the cam. Now i made a web page with code below

    <!--#if expr="(${REMOTE_ADDR} = /^192\.168\./) || (${REMOTE_ADDR} = /^10\.206\./) || (${REMOTE_ADDR} = /^10\.2\.1[0-9][0-9]\./) " --> <!--#set var="prefix" value="http://192.168.0.7/view/view.shtml" --> <!--#else --> <!--#set var="prefix" value="" --> <!--#endif -->

    <html>

    <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <meta name="GENERATOR" content="Microsoft FrontPage 4.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <title>Nova pagina 1</title> </head>

    <body>

    <A HREF="<!--#echo var="prefix"-->test">test</A> </body>

    </html>

    When I try to see the page in the internet explorer it shows me:

    test">test and when i put the cursor on it, it shows me : http://ip_extern