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: Wed Sep 04 2002 - 17:27:43 CDT

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

    php-general Digest 4 Sep 2002 22:27:43 -0000 Issue 1566

    Topics (messages 115152 through 115238):

    Re: Pass array in HTTP_POST_VARS question
            115152 by: Tim Ward
            115156 by: Marek Kilimajer

    Re: PHP / Bulk Email
            115153 by: Andrew Cowles
            115154 by: DL Neil
            115166 by: Manuel Lemos
            115167 by: Manuel Lemos

    Remote file download and https
            115155 by: Radu Manole
            115157 by: lallous
            115161 by: Justin French

    Re: SMS
            115158 by: nicos.php.net

    socket_read
            115159 by: BB

    Re: Uploading file
            115160 by: Justin French

    PHP and LDAP over SSL
            115162 by: Søren Henning Dalgaard
            115164 by: Søren Henning Dalgaard

    Apache 2.0
            115163 by: Lars Hecking
            115171 by: Erwin
            115172 by: Lars Hecking
            115206 by: Lars Hecking

    News Feeds....
            115165 by: Brian McGarvie
            115168 by: Stas Maximov

    Re: XML vs Everything Else
            115169 by: Geoff Hankerson
            115190 by: Javier Montserat
            115191 by: Geoff Hankerson
            115194 by: eriol
            115196 by: Rodolfo Gonzalez

    Re: Please help with fresh fish.
            115170 by: Anh

    fun with register_globals
            115173 by: Kelly Meeks
            115174 by: Adam Williams

    Re: Help with inserting Flash into MySQL database
            115175 by: Mike Krisher
            115202 by: Mitja Stepan

    question
            115176 by: dorevh.tiscali.nl
            115177 by: Richard Black
            115178 by: Steve Bradwell
            115182 by: skitum
            115186 by: Richard Black
            115195 by: David Buerer

    Closing Frames...
            115179 by: Kondwani Spike Mkandawire
            115180 by: Erwin

    How do I keep a page from caching in I.E
            115181 by: DonPro
            115189 by: Victor V. Evtushenko

    cyrillics
            115183 by: Vladislav Kulchitski

    String operation
            115184 by: Richard Fox
            115185 by: Bas Jobsen

    LOC counters
            115187 by: Todd Pasley
            115188 by: Robert Cummings

    xml to mysql
            115192 by: DtM
            115201 by: Andrew Hill

    Project Suggestions
            115193 by: Ashley M. Kirchner
            115223 by: Johnson, Kirk
            115224 by: Ashley M. Kirchner

    Caching Problem
            115197 by: Roland Swingler
            115198 by: Jed Verity
            115199 by: Marek Kilimajer
            115200 by: Jed Verity

    php mysql error
            115203 by: ROBERT MCPEAK
            115204 by: Adam Williams
            115205 by: Jay Blanchard
            115207 by: Marek Kilimajer

    How do I get milliseconds?
            115208 by: DonPro
            115209 by: Jay Blanchard
            115211 by: Jay Blanchard
            115212 by: Jackson Miller
            115221 by: Mike richardson

    XML doubt
            115210 by: Rodrigo Dominguez
            115216 by: Geoff Hankerson
            115219 by: Geoff Hankerson
            115234 by: Rodrigo Dominguez

    simple problem
            115213 by: Cirkit Braker
            115214 by: Philip Hallstrom
            115215 by: Rasmus Lerdorf
            115217 by: Adam Williams
            115218 by: nicos.php.net
            115220 by: nicos.php.net

    PHP/XML (Validation)
            115222 by: Robert Samuel White

    LDAP Authentication problem
            115225 by: Brad Harriger

    check for a number
            115226 by: Fifield, Mike
            115227 by: Steve Bradwell
            115228 by: Chris Boget
            115229 by: nicos.php.net

    multiple keywords in search boxes
            115230 by: Jason
            115233 by: Robert Cummings

    Re: sorting array question
            115231 by: timo stamm

    Re: continuation to the ftp story
            115232 by: timo stamm

    Re: limit in a loop function to prevent server load
            115235 by: timo stamm

    phpdoc CHM 9th sample out
            115236 by: Gabor Hojtsy

    post doesn't work?
            115237 by: Matt Zur
            115238 by: nicos.php.net

    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:


    you just name the form elements as array elements, e.g. with explicit keys
            name='array[0]' name='array[1]' etc.
    or allowing php to assign the keys
            name='array[]' name='array[]' etc.

    then the array is an element of $HTTP_POST_VARS[] when the form is posted

    Tim Ward
    www.chessish.com

    > -----Original Message-----
    > From: Paul Maine [mailto:pmaineaustin.rr.com]
    > Sent: 04 September 2002 03:25
    > To: PHP PHP
    > Subject: Pass array in HTTP_POST_VARS question
    >
    >
    > Is it possible to pass an array in a form post? If so, how do
    > I reference
    > the array on the next page?
    >
    > Thank You
    > Paul
    > php
    >
    >

    attached mail follows:


    Don't forget to use urlencode after serializing.

    David Robley wrote:

    >In article <AGEOIIKDIJBPINCJIFJKIENOCIAA.pmaineaustin.rr.com>,
    >pmaineaustin.rr.com says...
    >
    >
    >>Is it possible to pass an array in a form post? If so, how do I reference
    >>the array on the next page?
    >>
    >>Thank You
    >>Paul
    >>php
    >>
    >>
    >
    >I believe you may need serialize/unserialize here. Use serialize($array)
    >to create a simple variable that can be passed, then at the other end, use
    >unserialize to restore it.
    >
    >http://www.php.net/serialize for more info
    >
    >
    >

    attached mail follows:


    Hi Guys / gals,

    I ran a test recently sending emails to a list of clients (1000 or so)
    from a PHP / MySQL powered system.
    When sending via Sendmail this was VERY slow, taking several minutes to
    complete.
    When I switched over to Qmail the whole process takes only 10 or 15
    seconds.
    Seems it's the MTA that causes the biggest overhead in the equation... and
    Qmail is so much nicer than Sendmail!
    Cheers,

    Andy

    Andrew Cowles
    KAPOW! SMS Gateway
    http://www.kapow.co.uk/

    ---
    To text or not to text.. that is A question.
    

    attached mail follows:


    > Hi Guys / gals, > > I ran a test recently sending emails to a list of clients (1000 or so) > from a PHP / MySQL powered system. > When sending via Sendmail this was VERY slow, taking several minutes to > complete. > When I switched over to Qmail the whole process takes only 10 or 15 > seconds. > Seems it's the MTA that causes the biggest overhead in the equation... and > Qmail is so much nicer than Sendmail!

    IIRC it is also an area where the Windows implementation of PHP is superior (for a pleasant change) on a volume/performance basis (I read somewhere that this is because a stub SMTP service is included in the interface).

    Regards, =dn

    attached mail follows:


    Hello,

    On 09/04/2002 08:05 AM, Andrew Cowles wrote: > I ran a test recently sending emails to a list of clients (1000 or so) > from a PHP / MySQL powered system. > When sending via Sendmail this was VERY slow, taking several minutes to > complete. > When I switched over to Qmail the whole process takes only 10 or 15 > seconds. > Seems it's the MTA that causes the biggest overhead in the equation... and > Qmail is so much nicer than Sendmail!

    That is because you have configured sendmail to send messages immediatly if possible. If you configure it to just queue the messages and not wait for having them delivered right away, it will pratically as fast as qmail because it will be doing as less.

    -- 
    

    Regards, Manuel Lemos

    attached mail follows:


    On 09/04/2002 07:52 AM, Dl Neil wrote: >>I ran a test recently sending emails to a list of clients (1000 or so) >>from a PHP / MySQL powered system. >>When sending via Sendmail this was VERY slow, taking several minutes to >>complete. >>When I switched over to Qmail the whole process takes only 10 or 15 >>seconds. >>Seems it's the MTA that causes the biggest overhead in the equation... and >>Qmail is so much nicer than Sendmail! > > > > IIRC it is also an area where the Windows implementation of PHP is superior > (for a pleasant change) on a volume/performance basis (I read somewhere that > this is because a stub SMTP service is included in the interface).

    I don't get where people get these ideas. Queuing messages to the local SMTP server as is done in PHP for Windows, is the slowest way to queue messages because it requires a TCP connection where each address has to be accepted individually by the SMTP server.

    This is very slow when compared with direct injection of messages in the mail queue which is what Unix MTAs do.

    There seems to be better ways to queue messages under Windows than just send them to the local SMTP server.

    -- 
    

    Regards, Manuel Lemos

    attached mail follows:


    Hi Guys,

    I'm trying to create a "transparent download" using a script (the script would run from my local machine) that will request a file from a remote server, that looks like this (https request): https://www.httpsserver.net/Pages/Download.asp?usr=test&pass=test&from=05/01 /02&to=09/03/02 This link will trigger an excel file download.

    I tryed with fsockopen() and fopen() but no luck. Also the Header ("Location: $myurl") starts the download but redirect the user to httpsserver. Any ideas and hints to start this transparent download would be much appreciated. Maybe to use a popup window?

    Many Thanks, Radu

    attached mail follows:


    Do you have SSL library installed? check that PHPINFO() i guess.

    You can also try to run curl() (if they have SSL support).

    Otherwise, It will be hard to implement SSL from pure PHP sockets functions.

    Elias

    "Radu Manole" <raduu-zine.com> wrote in message news:001401c25404$a52baae0$0f00a8c0uzine.com... > Hi Guys, > > I'm trying to create a "transparent download" using a script (the script > would run from my local machine) that will request a file from a remote > server, that looks like this (https request): > https://www.httpsserver.net/Pages/Download.asp?usr=test&pass=test&from=05/01 > /02&to=09/03/02 > This link will trigger an excel file download. > > I tryed with fsockopen() and fopen() but no luck. > Also the Header ("Location: $myurl") starts the download but redirect the > user to httpsserver. > Any ideas and hints to start this transparent download would be much > appreciated. Maybe to use a popup window? > > Many Thanks, > Radu > >

    attached mail follows:


    There is a download script (commonly used for restricting downloads to members, etc) on Zend.com... if you can't find it (in tutorials or articles), let me know.

    It should give you a good understanding of the principals, and a decent head start on the code, as it did for me.

    I don't think there will be any problem with SSL (https://) as long as your server is set-up for it...

    Justin

    on 04/09/02 9:17 PM, Radu Manole (raduu-zine.com) wrote:

    > Hi Guys, > > I'm trying to create a "transparent download" using a script (the script > would run from my local machine) that will request a file from a remote > server, that looks like this (https request): > https://www.httpsserver.net/Pages/Download.asp?usr=test&pass=test&from=05/01 > /02&to=09/03/02 > This link will trigger an excel file download. > > I tryed with fsockopen() and fopen() but no luck. > Also the Header ("Location: $myurl") starts the download but redirect the > user to httpsserver. > Any ideas and hints to start this transparent download would be much > appreciated. Maybe to use a popup window? > > Many Thanks, > Radu > >

    attached mail follows:


    Hi, This has nothing really to do with PHP, but, you can't excepted if you work for a company that got the right to do it.

    --
    

    Nicos - CHAILLAN Nicolas nicosphp.net www.WorldAKT.com - Hébergement de sites Internet

    "Lejanson C. Go" <lejansonntsp.nec.co.jp> a écrit dans le message de news: 3D75B222.2040805ntsp.nec.co.jp... > what are the components to be use if you want to set > up a site that SENDS Free SMS and uses PHP? > > -- > Lejanson C. Go, SDE I >

    attached mail follows:


    I'm having a problem with socket read, it's only reading one character. This may not sound so bad, but when you think that while it's reading all those one characters, it cannot read anyone else's (it blocks).

    Can anyone explain, or have a better way of doing this?

    Code below: <?php set_time_limit(0);

    define('MAXLINE', 255); define('LISTENQ', 10); define('PORT', 10000);

    function killDaemon() { global $listenfd, $client;

    socket_close($listenfd); $msg = "Daemon going down!\n"; for ($i = 0; $i < count($client); $i++) { if ($client[$i] != null) { socket_write($client[$i], $msg, strlen($msg)); socket_close($client[$i]); } } print "Shutting down the daemon\n"; exit(); }

    function closeClient($i) { global $client, $remote_host, $remote_port;

    print "closing client[$i] ({$remote_host[$i]}:{$remote_port[$i]})\n";

    socket_close($client[$i]); $client[$i] = null; unset($remote_host[$i]); unset($remote_port[$i]); }

    $listenfd = socket_create(AF_INET, SOCK_STREAM, 0); if ($listenfd) print "Listening on port " . PORT . "\n"; else die("AIEE -- socket died!\n");

    socket_setopt($listenfd, SOL_SOCKET, SO_REUSEADDR, 1); if (!socket_bind($listenfd, "127.0.0.1", PORT)) { socket_close($listenfd); die("AIEE -- Couldn't bind!\n"); } socket_listen($listenfd, LISTENQ);

    for ($i = 0; $i < 1; $i++) $client[$i] = null;

    while(1) { $rfds[0] = $listenfd;

    for ($i = 0; $i < count($client); $i++) { if ($client[$i] != null) $rfds[$i + 1] = $client[$i]; }

    $nready = socket_select($rfds, $null, $null, null);

    if (in_array($listenfd, $rfds)) { print "listenfd heard something, setting up new client\n"; for ($i = 0; $i <= count($client); $i++) { if ($client[$i] == null) { $client[$i] = socket_accept($listenfd); socket_setopt($client[$i], SOL_SOCKET, SO_REUSEADDR, 1); socket_getpeername($client[$i], $remote_host[$i], $remote_port[$i]); socket_write($client[$i], "Welcome to my test server\r\n"); print "Accepted {$remote_host[$i]}:{$remote_port[$i]} as client[$i]\n"; break; } } if (--$nready <= 0) continue; }

    for ($i = 0; $i < count($client); $i++) { if ($client[$i] == null) continue; if (in_array($client[$i], $rfds)) { $rawStr = ""; $n = ""; while (false !== ($n = socket_read($client[$i], MAXLINE))) { if (ord($n) == 0 || ord($n) == 13) break; if (ord($n) == 8) $rawStr = substr($rawStr, 0, -1);

    $rawStr .= $n; } if (trim($rawStr) == "") continue;

    if ($rawStr == "/killme") killDaemon(); else if ($rawStr == "/quit") closeClient($i); else { print "From {$remote_host[$i]}:{$remote_port[$i]}, client[$i]: $rawStr\n"; for ($j = 0; $j < count($client); $j++) { if ($client[$j] != null) socket_write($client[$j], "From client[$i]: $rawStr\r\n"); } if (--$nready <= 0) break; } } } //end of for loop

    } //end of master loop ?>

    attached mail follows:


    There is a perfecting good working example of file uploads on php.net... never quite sure why people re-invent the wheel all the time.

    In the example (at http://www.php.net/manual/en/features.file-upload.php), they make a call to move_uploaded_file()... until you do that, and move it to where you want, it IS in the temporary location, set my php.ini, although it may get deleted at the end of the script if it hasn't been moved elsewhere... you need to move the uploaded file to an area within your disc hierarchy.

    Justin

    on 04/09/02 8:16 PM, skitum (skitumhotmail.com) wrote:

    > i have the same problem. Where is the kind soul who can help us? > > Peace & Love > skitum > > ----- Original Message ----- > From: "Clemson Chan" <clemsonchanearthlink.net> > To: "Juan Pablo Aqueveque" <juqueuct.cl>; <php-generallists.php.net> > Sent: Wednesday, September 04, 2002 12:25 AM > Subject: RE: [PHP] Uploading file > > >> Thanks Juan, and other listers, >> >> I have this example, >> >> <HTML> >> <HEAD> >> <TITLE>Figure 7-3</TITLE> >> </HEAD> >> <BODY> >> <? >> //check for file upload >> if(isset($UploadedFile)) >> { >> unlink($UploadedFile); >> print("Local File: $UploadedFile <BR>\n"); >> print("Name: $UploadedFile_name <BR>\n"); >> print("Size: $UploadedFile_size <BR>\n"); >> print("Type: $UploadedFile_type <BR>\n"); >> print("<HR>\n"); >> } >> ?> >> <FORM ENCTYPE="multipart/form-data" >> ACTION="7-3.php" METHOD="post"> >> <INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="4096000"> >> <INPUT NAME="UploadedFile" TYPE="file"> >> <INPUT TYPE="submit" VALUE="Upload"> >> </FORM> >> >> </BODY> >> </HTML> >> >> and the result is this after I uploaded a file >> >> Local File: /tmp/phpnYLV2J >> Name: 323lake.jpg >> Size: 48254 >> Type: image/pjpeg >> >> But I couldn't find the uploaded file, nor the /tmp/phpnYLV2J path. >> Do I normally do a copy after the upload? >> Can I just change the tmp path and filename when I upload? >> Thanks. >> >> --Clemson >> >> >> >> -----Original Message----- >> From: Juan Pablo Aqueveque [mailto:juqueuct.cl] >> Sent: Tuesday, September 03, 2002 7:58 AM >> To: Clemson Chan; php-generallists.php.net >> Subject: Re: [PHP] Uploading file >> >> >> Hi friend, >> >> http://www.php.net/manual/en/features.file-upload.php >> And take a look to the User Contributed Notes >> >> --jp >> >> At 13:03 03-09-2002 -0700, Clemson Chan wrote: >>> Hi, I am new to this group. >>> I am trying to figure out how to let people to upload image files to my >>> website. >>> My ISP is using PHP 3 (I believe). >>> If someone can give me simple example, that will be great. >>> Thanks. >>> >>> --Clemson >>> >>> How can I tell what version of PHP is running on the system (linux)? >>> >>> >>> -- >>> PHP General Mailing List (http://www.php.net/) >>> To unsubscribe, visit: http://www.php.net/unsub.php >> >> ________________________________________________________ >> Juan Pablo Aqueveque <juqueuct.cl> >> Ingeniero de Sistemas >> Departamento de Redes y Comunicaciones http://www.drc.uct.cl >> Universidad Católica de Temuco. >> Tel:(5645) 205 630 Fax:(5645) 205 628 >> >> >> -- >> 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:


    I'm new to both PHP, LDAP and SSL so I'm really asking for direction on where to start.

    I have an OpenLDAP server on a Linux box, and a Microsoft ISS on Windows 2000 with PHP-scripting. I have made a couple of PHP scripts that access the LDAP database for reading and writing. All works fine so fare.

    I have installed a certificate on both the Web server and the LDAP server and moved to https communication between the client and the Web server. Now I want to move to SSL communication between the Web server and the LDAP server.

    I can make an ldap_connect with the ldaps://hostname/ parameter but what next: How can make an ldap_bind command? How can I encrypt and decrypt the data? How do I specify a key/certificate for encrypting and decrypting?

    Søren Henning Dalgaard

    attached mail follows:


    I'm new to both PHP, LDAP and SSL so I'm really asking for direction on where to start.

    I have an OpenLDAP server on a Linux box, and a Microsoft ISS on Windows 2000 with PHP-scripting. I have made a couple of PHP scripts that access the LDAP database for reading and writing. All works fine so fare.

    I have installed a certificate on both the Web server and the LDAP server and moved to https communication between the client and the Web server, and now I want to move to SSL communication between the Web server and the LDAP server.

    I can make an ldap_connect with the ldaps://hostname/ parameter but what next: How can make an ldap_bind command? How can I encrypt and decrypt the data? How do I specify a key/certificate for encrypting and decrypting?

    Søren Henning Dalgaard

    attached mail follows:


    Hi all,

    I'm setting up a test server with Apache 2.0.40 and php. I downloaded the latest php4 snapshot, compiled and installed it (a real PITA, but I managed), added

    LoadModule php4_module modules/libphp4.so

    and

    AddType application/x-httpd-php .php

    to httpd.conf, but my browser still doesn't show a php test page, it rather prompts for download.

    This is on Solaris 8, and AFAICT apache is configured for prefork. What did I miss?

    # ./bin/httpd -l Compiled in modules: core.c mod_access.c mod_auth.c mod_include.c mod_log_config.c mod_env.c mod_setenvif.c mod_ssl.c prefork.c http_core.c mod_mime.c mod_status.c mod_autoindex.c mod_asis.c mod_cgi.c mod_negotiation.c mod_dir.c mod_imap.c mod_actions.c mod_userdir.c mod_alias.c mod_so.c

    attached mail follows:


    Lars Hecking wrote: > Hi all, > > I'm setting up a test server with Apache 2.0.40 and php. I > downloaded the latest php4 snapshot, compiled and installed it (a > real PITA, but I managed), added > > LoadModule php4_module modules/libphp4.so > > and > > AddType application/x-httpd-php .php > > to httpd.conf, but my browser still doesn't show a php test page, it > rather prompts for download.

    Add the following to the bottom of your httpd.conf

    <FilesMatch "\.php$"> SetOutputFilter PHP SetInputFilter PHP </FilesMatch>

    HTH Erwin

    attached mail follows:


    > Add the following to the bottom of your httpd.conf > > <FilesMatch "\.php$"> > SetOutputFilter PHP > SetInputFilter PHP > </FilesMatch> No luck.

    error_log: [Wed Sep 04 15:01:44 2002] [notice] Apache/2.0.40 (Unix) mod_ssl/2.0.40 OpenSSL/0.9.6g PHP/4.3.0-dev configured -- resuming normal operations

    access_log: 10.1.65.81 - - [04/Sep/2002:15:01:51 +0100] "GET /home/lhecking/test.php HTTP/1.1" 304 0

    Do I need to do something special to generally enable such filters?

    attached mail follows:


    > No luck. > > error_log: > [Wed Sep 04 15:01:44 2002] [notice] Apache/2.0.40 (Unix) mod_ssl/2.0.40 OpenSSL/0.9.6g PHP/4.3.0-dev configured -- resuming normal operations > > access_log: > 10.1.65.81 - - [04/Sep/2002:15:01:51 +0100] "GET /home/lhecking/test.php HTTP/1.1" 304 0 Found the problem: following the PHP INSTALL document, I put php.ini into $prefix/lib. But I was using the --with-config-file-path configure option to search for it in apache's conf directory (I'm using the same meta- configure script for php across all servers - why I set the conf file path up like this in the first place, I can't remember).

    Sorry for bothering everyone :)

    attached mail follows:


    Hi....

    I'd like to get some news from any reputable news site, bbc.co.uk... yahoo.co.uk etc etc....

    UK news would be best, if not then some hints to how to go about it would be much appreciated!

    TIA...

    attached mail follows:


    Try www.moreover.com

    HTH Stas

    ----- Original Message ----- From: "Brian McGarvie" <brian.mcgarvieanypurposeloans.co.uk> To: <php-generallists.php.net> Sent: Wednesday, September 04, 2002 1:52 PM Subject: [PHP] News Feeds....

    > Hi.... > > I'd like to get some news from any reputable news site, bbc.co.uk... > yahoo.co.uk etc etc.... > > UK news would be best, if not then some hints to how to go about it would be > much appreciated! > > TIA... > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

    attached mail follows:


    Rodrigo Dominguez wrote:

    >I'm writting an application, a control panel for a web site, and it will be >great if I can separe data from presentation, I know that I have to work >with XML and XSL but I didn't understand how it works. > >Can you give me a simple example? > >Let guess that a client request index.php, and I have index.xml for the >data, index.xsl for the data transformation and index.php, how it works? > > From the php manaul:

    <?php

    // Allocate a new XSLT processor $xh = xslt_create();

    // Process the document if (xslt_process($xh, 'sample.xml', 'sample.xsl', 'result.xml')) { print "SUCCESS, sample.xml was transformed by sample.xsl into result.xml"; print ", result.xml has the following contents\n<br>\n"; print "<pre>\n"; readfile('result.xml'); print "</pre>\n"; } else { print "Sorry, sample.xml could not be transformed by sample.xsl into"; print " result.xml the reason is that " . xslt_error($xh) . " and the "; print "error code is " . xslt_errno($xh); }

    xslt_free($xh);

    ?>

    > >

    attached mail follows:


    >Spend some time learning about xml and you won't regret it

    Could you (or anyone else on the list) recommend some good resources (Books / Websites) for learning XML and XSLT?

    Thanks,

    Javier

    _________________________________________________________________ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx

    attached mail follows:


    Javier Montserat wrote:

    >> Spend some time learning about xml and you won't regret it > > > Could you (or anyone else on the list) recommend some good resources > (Books / Websites) for learning XML and XSLT? > > Thanks, > > Javier > > > > http://www.devshed.com/Server_Side/XML

    http://www.xml.com (look for the essentials articles on the left)

    attached mail follows:


    http://www.w3schools.com/xml/default.asp has some tutorials.. It helped me understand the basics of XML and what it can be used for.. They also have some XSL(T) information and tutorials (http://www.w3schools.com/xsl/default.asp) as well..

    Take care.. peace.. eriol

    ====

    "Javier Montserat" <codareefhotmail.com> disgorged:

    : Could you (or anyone else on the list) recommend some good resources (Books : / Websites) for learning XML and XSLT?

    attached mail follows:


    On Tue, 3 Sep 2002, Geoff Hankerson wrote: > Spend some time learning about xml and you won't regret it

    Sorry for the off topic, but in fact XML is not that hard to learn, it's just custom markup that needs to follow certain rules. The important part is the parser or the program logic to work with the XML documents, IMHO.

    Sorry again.

    attached mail follows:


    Hello Rene,

    Thanks a lots.

    >You already found the best PHP forum there is ;-)

    I believe so :-)

    Anh

    "René moonen" <rene.moonenoberthur.nl> wrote in message news:3D75B192.80101oberthur.nl... > Anh wrote: > > >Hello everyone, > > > >I would like to study PHP but do not have any experience about PHP or > >programming. Could you please give me some advice to begin such as books, > >news, forum... > > > >Many thanks in advance, > >Anh > > > > > > > > > > > You already found the best PHP forum there is ;-) > > René > > > >

    attached mail follows:


    Hi folks,

    I might be late to the game with these questions, but I've just been bit by the register_globals=off situation.

    I'm trying to figure out the scope of what I need to change to accomodate register_globals=off, and I need some help.

    Looking around php.net, for example:

    'If register_globals = on, the url http://www.example.com/test.php?id=3 will produce $id.' I can only assume with register globals being set to off, the reverse of this would be true. If so, how do I get the value of id in that case?

    Kelly

    attached mail follows:


    use

    $_GET[id]

    in the place of $id for each instance. Like if you had $new = $id + 1 change it to $new = $_GET[id] + 1

    and such...

    Adam

    On Wed, 4 Sep 2002, Kelly Meeks wrote:

    > Hi folks, > > I might be late to the game with these questions, but I've just been bit by the register_globals=off situation. > > I'm trying to figure out the scope of what I need to change to accomodate register_globals=off, and I need some help. > > Looking around php.net, for example: > > 'If register_globals = on, the url http://www.example.com/test.php?id\3will produce $id.' > I can only assume with register globals being set to off, the reverse of this would be true. If so, how do I get the value of id in that case? > > Kelly >

    attached mail follows:


    Right, but you need to insert your code block in a way that it is executed and then returns the name of a swf to load. Right now you are loading the client side object/embed tags that then calls another PHP file that returns the name or value of your SWF. You need to combine the two files and return the value of the SWF on the first parse so the filepath is there once the object/embed tags are rendered on the client side.

    I hope that makes sense, -- Mike

    attached mail follows:


    I don't thin I understand that... :) Can you give me an example. Or if I understand correctly, I have to use "interface", a .swf file (caled with <object> tags) and this .swf file have to get information (data form database) throught .php file...?

    --
    Lp,
    Mitja
    "Mike Krisher" <onepersontwopeoplecommunicating.com> wrote in message
    news:ANEGKFJDOIHKPPAIBKAJOEPIGFAA.onepersontwopeoplecommunicating.com...
    > Right, but you need to insert your code block in a way that it is
    > executed and then returns the name of a swf to load. Right now you are
    > loading the client side object/embed tags that then calls another PHP
    > file that returns the name or value of your SWF. You need to combine
    > the two files and return the value of the SWF on the first parse so
    > the filepath is there once the object/embed tags are rendered on the
    > client side.
    >
    > I hope that makes sense,
    > -- Mike
    >
    

    attached mail follows:


    I have a php question.

    I would like to enter a "while" loop, but: I want it to be like this:

    when $a has a value, while $a... when $b has a value, while $b... (same statements as with $a) when $a has a value, and $b has a value, while $a and $b

    this is based on a search system in which the user can enter a, b or a and b.

    Can you help me with my problem, or help me find someone who can?!

    Thanks.

    Dore van Hoorn.

    attached mail follows:


    Can you provide a bit more info??? Maybe a real life example of what you're trying to accomplish???

    Richy

    ========================================== Richard Black Senior Developer, DataVisibility Ltd - http://www.datavisibility.com Tel: 0141 951 3481 Email: rblackdatavisibility.co.uk

    -----Original Message----- From: dorevhtiscali.nl [mailto:dorevhtiscali.nl] Sent: 04 September 2002 15:26 To: php-generallists.php.net Subject: [PHP] question

    I have a php question.

    I would like to enter a "while" loop, but: I want it to be like this:

    when $a has a value, while $a... when $b has a value, while $b... (same statements as with $a) when $a has a value, and $b has a value, while $a and $b

    this is based on a search system in which the user can enter a, b or a and b.

    Can you help me with my problem, or help me find someone who can?!

    Thanks.

    Dore van Hoorn.

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

    attached mail follows:


    Maybe try somthing like this, write a function containing all your like statements.

    function likeStatements( ){

    //write your statements in this function if they are always the same.

    }

    //then have an if structure like the following that calls that function in a while loop.

    if ( isset($a) && !isset($b) ){ while ($a){ likeStatements(); //you could also pass any needed info to the function. } }elseif( isset($b) && !isset($a) ){ while ($b){ likeStatements(); } }elseif( isset($a) && isset($b) ){ while ($a && $b){ likeStatements(); } }

    HTH, Steve. -----Original Message----- From: dorevhtiscali.nl [mailto:dorevhtiscali.nl] Sent: Wednesday, September 04, 2002 10:26 AM To: php-generallists.php.net Subject: [PHP] question

    I have a php question.

    I would like to enter a "while" loop, but: I want it to be like this:

    when $a has a value, while $a... when $b has a value, while $b... (same statements as with $a) when $a has a value, and $b has a value, while $a and $b

    this is based on a search system in which the user can enter a, b or a and b.

    Can you help me with my problem, or help me find someone who can?!

    Thanks.

    Dore van Hoorn.

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

    attached mail follows:


    I'm not sure what do you want to do, but maybe this can help you:

    if($a == $value && $b == $value) { //do something } elseif($a == $value && $b != $value) { //... } elseif($a != $value && $b == $value) { //... } else { //... }

    I hope this help

    Peace & Love skitum

    ----- Original Message ----- From: <dorevhtiscali.nl> To: <php-generallists.php.net> Sent: Wednesday, September 04, 2002 4:26 PM Subject: [PHP] question

    > I have a php question. > > I would like to enter a "while" loop, but: > I want it to be like this: > > when $a has a value, while $a... > when $b has a value, while $b... (same statements as with $a) > when $a has a value, and $b has a value, while $a and $b > > this is based on a search system in which the user can enter a, b or a and > b. > > Can you help me with my problem, or help me find someone who can?! > > Thanks. > > Dore van Hoorn. > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    Where are you generating the query and fetching the row?

    And what are the queries being run?

    Possibly a better way to do the first bit would be as follows:

    $and = ""; if ($itemname) { echo $n."&nbsp;".$name."</font>"; $and = " and "; } if ($itemcolor) { echo $and.$c."&nbsp;".$color."</font>"; }

    (I've condensed the multiple echo statements into one to reduce the number of lines, but this is more about the logic)

    Depending on what your query is searching on and returning, you may be able to do it in a single query.

    HTH,

    Richy

    ========================================== Richard Black Senior Developer, DataVisibility Ltd - http://www.datavisibility.com Tel: 0141 951 3481 Email: rblackdatavisibility.co.uk

    -----Original Message----- From: dorevhtiscali.nl [mailto:dorevhtiscali.nl] Sent: 04 September 2002 15:41 To: Richard Black Subject: Betr: RE: [PHP] question

    if ($gevonden >= 1) { echo "&nbsp;<b>The search for "; if ($itemname) { echo $n; echo "&nbsp;"; echo $name; echo "</font>"; } if ($itemcolor) { if ($itemname) { echo " and "; } echo $c; echo "&nbsp;"; echo $color; echo "</font>"; } echo " delivers the following results</b><p/>";

    }

    so the above if statements handle the same problem. if $itemname has a value, print $n and $name if $itemcolor has a value, print $c and $color if $itemcolor has a value and $itemname has a value, the following will be printed: $n $name "and" $c $color

    After this if statement, a while statement is entered:

    while ($myrow = mysql_fetch_row($itemname)) { a lot of echo's }

    but what if, itemname is empty, but itemcolor is not. or what to do if both have a value?!

    I hope this explanes my problem more clearly!?

    Dore van Hoorn.

    attached mail follows:


    while($a) { [statments] } while($b) { [statments] } while($c) { [statments] }

    or

    while(isset($a)) { [statments] } while(isset($b)) { [statments] } while(isset($c)) { [statments] }

    would both work well depending on your particular situation

    -----Original Message----- From: Richard Black [mailto:rblackdatavisibility.co.uk] Sent: Wednesday, September 04, 2002 7:32 AM To: dorevhtiscali.nl; Php-General Subject: RE: [PHP] question

    Can you provide a bit more info??? Maybe a real life example of what you're trying to accomplish???

    Richy

    ========================================== Richard Black Senior Developer, DataVisibility Ltd - http://www.datavisibility.com Tel: 0141 951 3481 Email: rblackdatavisibility.co.uk

    -----Original Message----- From: dorevhtiscali.nl [mailto:dorevhtiscali.nl] Sent: 04 September 2002 15:26 To: php-generallists.php.net Subject: [PHP] question

    I have a php question.

    I would like to enter a "while" loop, but: I want it to be like this:

    when $a has a value, while $a... when $b has a value, while $b... (same statements as with $a) when $a has a value, and $b has a value, while $a and $b

    this is based on a search system in which the user can enter a, b or a and b.

    Can you help me with my problem, or help me find someone who can?!

    Thanks.

    Dore van Hoorn.

    -- 
    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:


    How can I go about closing a Frame using PHP would this be possible considering that PHP is Server Side? I am assuming Frame closing is similar to Window closing (I am trying to avoid doing this in JavaScript in case someone has JavaScript disabled on their browser)...

    Thanks in advance...

    Spike...

    attached mail follows:


    Kondwani Spike Mkandawire wrote: > How can I go about closing a Frame using PHP would this > be possible considering that PHP is Server Side? > I am assuming Frame closing is similar to Window > closing (I am trying to avoid doing this in JavaScript > in case someone has JavaScript disabled on their browser)...

    Closing frames and windows is done client side, so PHP can't do that. Besides, closing these things is done with Javascript, so you can't around it if you want to add this functionality.

    HTH Erwin

    attached mail follows:


    Hi,

    Using I.E. 5.5. I can't seem to keep a page from caching. When I click on the browser BACK button, I get the cached page so I have to click on Refresh to get the actual page content. I've placed the following at the top of the HTML file but it doesn't seem to do anything. Any help would be appreciated.

    <?PHP header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); ?>

    attached mail follows:


    Hi,

    Donpro wrote: > Hi, > > Using I.E. 5.5. I can't seem to keep a page from caching. When I click on

    Have you read "HOWTO: Prevent Caching in Internet Explorer"? http://support.microsoft.com/default.aspx?scid=kb;EN-US;q234067

    > the browser BACK button, I get the cached page so I have to click on Refresh > to get the actual page content. I've placed the following at the top of the > HTML file but it doesn't seem to do anything. Any help would be appreciated.

    Victor.

    attached mail follows:


    Hi, I just created a forum and now beta-testing it, I am having problems submitting entries written in cyrillics. It sort of recognizes cyrillics in <textarea> but recodes it so that it makes it unreadable, while in <input text="" name=""> it doesn't recognize cyrillics at all and acts as though no input has been made. If someone has had similar problems, please help.

    Thanks, Vlad

    attached mail follows:


    Hi

    Given

    string1 = /home/web/ string2 = /home/web/www/index.php

    How can I elegantly do an exclusive or of string1 with string2, that is, I want to end up with

    string3 = www/index.php

    Thanks!

    attached mail follows:


    $string3 = str_replace($string1,'',$string2); ??????? Op woensdag 04 september 2002 17:04, schreef Richard Fox: > Hi > > Given > > string1 = /home/web/ > string2 = /home/web/www/index.php > > How can I elegantly do an exclusive or of string1 with string2, that is, I > want to end up with > > string3 = www/index.php > > Thanks!

    attached mail follows:


    Hi,

    Firstly, please resist the opportunity to flame....

    I'm looking for a PHP (among other things) Line Of Code counter. Has anyone used any descent ones? I was thinking of writing one myself, but, if there are others available, I might as well save the time.

    There is much debate over the appropriateness of LOC as a measurement, I have chewed up a lot of time with discussion over this so I'm not going to bite this time :)

    Thanks,

    Todd.

    attached mail follows:


    Todd Pasley wrote: > > Hi, > > Firstly, please resist the opportunity to flame.... > > I'm looking for a PHP (among other things) Line Of Code counter. Has anyone > used any descent ones? I was thinking of writing one myself, but, if there > are others available, I might as well save the time. > > There is much debate over the appropriateness of LOC as a measurement, I > have chewed up a lot of time with discussion over this so I'm not going to > bite this time :)

    I like this quick and dirty solution which doesn't count lines with just braces or just whitespace. nor does it count C++ style comment lines. I have it in my .bashrc file:

    alias countcode='cat *.inc */*.inc */*/*.inc */*/*/*.inc */*/*/*/*.inc */*/*/*/*/*.inc */*/*/*/*/*/*.inc */*/*/*/*/*/*/*.inc | grep -v '\''^[[:space:]]*$'\'' | grep -v '\''^[[:space:]]*[{}][[:space:]]*$'\'' | grep -v '\''^[[:space:]]*//'\'' | grep -v '\''^<?//'\'' | grep -c '\''.*'\'''

    Then from my linux command line I just type countcode. And yes I know I could have come up with something better than */*/*/..., but like I said "QUICK AND DIRTY" :)

    Cheers, Rob.

    -- 
    .-----------------.
    | Robert Cummings |
    :-----------------`----------------------------.
    | Webdeployer - Chief PHP and Java Programmer  |
    :----------------------------------------------:
    | Mail  : mailto:robert.cummingswebmotion.com |
    | Phone : (613) 731-4046 x.109                 |
    :----------------------------------------------:
    | Website : http://www.webmotion.com           |
    | Fax     : (613) 260-9545                     |
    `----------------------------------------------'
    

    attached mail follows:


    Hi,

    Is there a way to create a DB from a xml file or it's better to use the xml file for DB, i have lot of files so i think a DB will be better. If you know a program or tutorial let me know.

    thanx.

    attached mail follows:


    Hi,

    Virtuoso http://www.openlinksw.com/virtuoso can do the opposite - represent tables and SQL queries, either from relational data in Virtuoso or another back-end database (including MySQL and all the usual suspects) and provide an XML document in real time for PHP to use.

    Virtuoso Universal Server is available as a free download - let me know what you think.

    Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access & Virtuoso Universal Server

    -----Original Message----- From: DtM [mailto:DtMprotento.com] Sent: Wednesday, September 04, 2002 11:28 AM To: php-generallists.php.net Subject: [PHP] xml to mysql

    Hi,

    Is there a way to create a DB from a xml file or it's better to use the xml file for DB, i have lot of files so i think a DB will be better. If you know a program or tutorial let me know.

    thanx.

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

    attached mail follows:


    I have a project that I need some help/suggestions on (actually, it's been "there" for over 3 years now, I just never addressed it.) I need to, somehow, make our company website "easier". When I say easier, I'm referring to how data gets posted on it. 90% of all of our pages contain prices for our products/services. A typical product/service page would consist of three main elements:

    - a description of said product/service - a price matrix - comments, notes and other pertinent information

    Some products are listed together right now and this will change (I will be listing everything on its own page, makes it easier to maintain later.)

    The price matrix varies by product/service. Some are small (a few columns, few rows), others are massive. I could possibly break down the comments section as well into smaller pieces (service time, notes, links to related services, etc., etc.), but for now these are the three main parts I will concentrate on.

    Right now, we have well over 500 pages of static information, and it gets to be a real pain whenever things get updated, or we change our products/services (some disappear, new one get added.)

    Things I want to do:

    - convert this site into a dynamic one, where I can very easily change the layout of things whenever it comes time to revamp the site into a new design. - insert all the products, their prices and related data into a database (which would tie in with the above item, maybe by means of functions, say, 'function show_product('inkjet_prints')' and have it create a page to present) - make it so that those responsible for price changes can make their own changes to the database, so I don't have to deal with it every time.

    I suspect many of you will tell me to use phpMyAdmin for the latter, however I need to keep in mind that these people are illiterate, and trying to teach them how to use something is like teaching a cat how to use the toilet (and even that has better success.) So, I would prefer some other method. Maybe a form page that has everything on it (top field for description, bunch of little input fields for the price matrix, and the stuff at the end), however I don't know how efficient that would be, specially on large matrices.

    I'd like to hear from people with some real life experience doing this. My whole issue with wanting to do this now is because of health issues. I'm trying to cut back on the amount of work I need to do.

    For those wanting to browse and see what kind of structure I have to deal with now, feel free. The site is listed in my signature.

    --
    W | I haven't lost my mind; it's backed up on tape somewhere.
      +--------------------------------------------------------------------
      Ashley M. Kirchner <mailto:ashleypcraft.com>   .   303.442.6410 x130
      IT Director / SysAdmin / WebSmith             .     800.441.3873 x130
      Photo Craft Laboratories, Inc.            .     3550 Arapahoe Ave. #6
      http://www.pcraft.com ..... .  .    .       Boulder, CO 80303, U.S.A.
    

    attached mail follows:


    > Things I want to do: > > - convert this site into a dynamic one, where I can very easily > change the layout of things whenever it comes time to revamp > the site into a new design.

    I have not worked with any of the templating systems, but here is a home-grown one. Separate the page HTML into 3 pieces. Two of the pieces form the "shell", which is the HTML that is constant across groups of pages. The third piece is the HTML that varies with each page. Build the two shell files so that they form an empty <td>, into which the dynamic piece goes:

    <? include("htmlShellHead.inc"); buildCurrentPage(); // or another include() include("htmlShellFoot.inc"); ?>

    Then, if you need to add a right-hand sidebar, for example, you just edit the shell files, and all the pages using that shell get updated at once. Simple way to update the look and feel across the whole site.

    > - insert all the products, their prices and related data into > a database (which would tie in with the above item, maybe by > means of functions, say, 'function > show_product('inkjet_prints')'

    Sounds good.

    > - make it so that those responsible for price changes can make > their own changes to the database, so I don't have to deal with > it every time.

    Making your own forms is probably best. We have done this with Java applets, which may be overkill for you. The main thing to think about here is authentication: making sure people can access only their own data and nobody else's. Also, make sure everyone involved shares a clear idea of who bears responsibility for update mistakes. If the user has the ability to change their data, they have the ability to screw it up. Make a clear oversight plan: how much reviewing of their changes you will do before the changes go live, etc.

    Good luck!

    Kirk

    attached mail follows:


    "Johnson, Kirk" wrote:

    > The main thing to think about here is > authentication: making sure people can access only their own data and nobody > else's. Also, make sure everyone involved shares a clear idea of who bears > responsibility for update mistakes. If the user has the ability to change > their data, they have the ability to screw it up.

    Only three people will ever get to do these updates, and I'm one of them.

    > Make a clear oversight > plan: how much reviewing of their changes you will do before the changes go > live, etc.

    Zip, none, no reviewing at all. At least, not from my part. They get to do their own damned reviewing, and if they screw up, being that they're the president and VP, they get to deal with the customer, not me. Not customer service.

    --
    W | I haven't lost my mind; it's backed up on tape somewhere.
      +--------------------------------------------------------------------
      Ashley M. Kirchner <mailto:ashleypcraft.com>   .   303.442.6410 x130
      IT Director / SysAdmin / WebSmith             .     800.441.3873 x130
      Photo Craft Laboratories, Inc.            .     3550 Arapahoe Ave. #6
      http://www.pcraft.com ..... .  .    .       Boulder, CO 80303, U.S.A.
    

    attached mail follows:


    ('binary' encoding is not supported, stored as-is) Hi

    I have a problem with caching on IE 5.1.4 on Mac Os X. (PHP 4.0.5)

    The page I want to use is a simple file upload page that works by:

    <?php if ($HTTP_POST_VARS['submit'] == "submit") { then upload the file... } ?> Rest of document.

    The form action returns to the same page (to allow you to upload another file).

    This works fine, but if you press the refresh btn, the file keeps uploading pictures. If you click in the address bar & press return, this does not happen.

    I have included the http headers to prevent caching as described in the documentation, but this hasn't seemed to work.

    Is this a quirk of the browser/os combination or is there something i'm missing.

    TIA

    Roland

    attached mail follows:


    Hi, Roland,

    There might be a better way to do this, but you could try to use the header() function after your upload takes place to redirect the browser to the same page, using GET. Something like...

    <?php if ($HTTP_POST_VARS['submit'] == "submit") { then upload the file... header("Location: http://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']."); } ?>

    Or something like that. HTH, Jed

    On the threshold of genius, Roland Swingler wrote:

    > Hi > > I have a problem with caching on IE 5.1.4 on Mac Os X. (PHP 4.0.5) > > The page I want to use is a simple file upload page that works by: > > <?php > if ($HTTP_POST_VARS['submit'] == "submit") { > then upload the file... > } > ?> > Rest of document. > > The form action returns to the same page (to allow you to upload another > file). > > This works fine, but if you press the refresh btn, the file keeps uploading > pictures. If you click in the address bar & press return, this does not > happen. > > I have included the http headers to prevent caching as described in the > documentation, but this hasn't seemed to work. > > Is this a quirk of the browser/os combination or is there something i'm > missing. > > TIA > > Roland >

    attached mail follows:


    Use header("Location: page.php"); to redirect the browser, you should allways do it after a post that changes or adds or deletes some data on the server.

    Roland Swingler wrote:

    >Hi > >I have a problem with caching on IE 5.1.4 on Mac Os X. (PHP 4.0.5) > >The page I want to use is a simple file upload page that works by: > ><?php >if ($HTTP_POST_VARS['submit'] == "submit") { > then upload the file... >} >?> >Rest of document. > >The form action returns to the same page (to allow you to upload another file). > >This works fine, but if you press the refresh btn, the file keeps uploading pictures. If you click in the address bar & press return, this does not happen. > >I have included the http headers to prevent caching as described in the documentation, but this hasn't seemed to work. > >Is this a quirk of the browser/os combination or is there something i'm missing. > >TIA > >Roland > > > >

    attached mail follows:


    Oops. There was an extra period at the end there (after PHP_SELF).

    <?php if ($HTTP_POST_VARS['submit'] == "submit") { then upload the file... header("Location: http://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']"); } ?>

    On the threshold of genius, Jed Verity wrote:

    > Hi, Roland, > > There might be a better way to do this, but you could try to use the > header() function after your upload takes place to redirect the browser to > the same page, using GET. Something like... > > <?php > if ($HTTP_POST_VARS['submit'] == "submit") { > then upload the file... > header("Location: http://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']."); > } > ?> > > Or something like that. HTH, > Jed > > On the threshold of genius, Roland Swingler wrote: > >> Hi >> >> I have a problem with caching on IE 5.1.4 on Mac Os X. (PHP 4.0.5) >> >> The page I want to use is a simple file upload page that works by: >> >> <?php >> if ($HTTP_POST_VARS['submit'] == "submit") { >> then upload the file... >> } >> ?> >> Rest of document. >> >> The form action returns to the same page (to allow you to upload another >> file). >> >> This works fine, but if you press the refresh btn, the file keeps uploading >> pictures. If you click in the address bar & press return, this does not >> happen. >> >> I have included the http headers to prevent caching as described in the >> documentation, but this hasn't seemed to work. >> >> Is this a quirk of the browser/os combination or is there something i'm >> missing. >> >> TIA >> >> Roland >> >

    attached mail follows:


    Our box recently went down and after reconfiguring it we're left with a semi-operation mySQL. One error I'm getting is this:

    mysql> select region from clip_art where region is not null and released = 'yes' group by region; ERROR 1: Can't create/write to file '/tmp/#sqld0e_76_1.MYI' (Errcode: 13)

    Removing the "group by" clause prevents the error.

    Can anybody tell me how to fix this?

    Thank you.

    attached mail follows:


    whats the permissions on /tmp? it should be set to 1777

    Adam

    On Wed, 4 Sep 2002, ROBERT MCPEAK wrote:

    > Our box recently went down and after reconfiguring it we're left with a > semi-operation mySQL. One error I'm getting is this: > > mysql> select region from clip_art where region is not null and > released = 'yes' group by region; > ERROR 1: Can't create/write to file '/tmp/#sqld0e_76_1.MYI' (Errcode: > 13) > > Removing the "group by" clause prevents the error. > > Can anybody tell me how to fix this? > > Thank you. > > > >

    attached mail follows:


    [snip] Our box recently went down and after reconfiguring it we're left with a semi-operation mySQL. One error I'm getting is this:

    mysql> select region from clip_art where region is not null and released = 'yes' group by region; ERROR 1: Can't create/write to file '/tmp/#sqld0e_76_1.MYI' (Errcode: 13)

    Removing the "group by" clause prevents the error. [/snip]

    Using perror 13 I get;

    rootmyserver:/var/www/htdocs# perror 13 Error code 13: Permission denied

    So perhaps /tmp/ or #sqld0e_76_1.MYI has the wrong permissions

    HTH!

    Jay

    attached mail follows:


    Check file and drectory permisions.

    ROBERT MCPEAK wrote:

    >Our box recently went down and after reconfiguring it we're left with a >semi-operation mySQL. One error I'm getting is this: > >mysql> select region from clip_art where region is not null and >released = 'yes' group by region; >ERROR 1: Can't create/write to file '/tmp/#sqld0e_76_1.MYI' (Errcode: >13) > >Removing the "group by" clause prevents the error. > >Can anybody tell me how to fix this? > >Thank you. > > > > >

    attached mail follows:


    Using the following code,

    date("His")

    I get the hours, minutes and seconds. Is there a way to extend this so that I get the milliseconds too?

    Thanks, Don

    attached mail follows:


    [snip] Using the following code,

    date("His")

    I get the hours, minutes and seconds. Is there a way to extend this so that I get the milliseconds too? [/snip]

    $ms = (date("s")/1000);

    I don't think that there is a method to return it. I looked through php.net (searched millisecond and milliseconds) and found some things which might point you in the right direction.

    HTH!

    Jay

    ***************************************************** * Texas PHP Developers Conf Spring 2003 * * T Bar M Resort & Conference Center * * New Braunfels, Texas * * Contact jay.blanchardniicommunications.com * * * * Want to present a paper or workshop? Contact now! * *****************************************************

    attached mail follows:


    [snip] [snip] Using the following code,

    date("His")

    I get the hours, minutes and seconds. Is there a way to extend this so that I get the milliseconds too? [/snip]

    $ms = (date("s")/1000);

    I don't think that there is a method to return it. I looked through php.net (searched millisecond and milliseconds) and found some things which might point you in the right direction. [/snip]

    Have a look at http://www.php.net/manual/en/printwn/function.microtime.php HTH!

    Jay

    ***************************************************** * Texas PHP Developers Conf Spring 2003 * * T Bar M Resort & Conference Center * * New Braunfels, Texas * * Contact jay.blanchardniicommunications.com * * * * Want to present a paper or workshop? Contact now! * *****************************************************

    attached mail follows:


    microtime();

    will return microseconds. That is not milliseconds, but it may or may not solve your problem.

    I don't think there is a way to get milliseconds.

    -Jackson

    On Wed, 2002-09-04 at 14:47, DonPro wrote: > Using the following code, > > date("His") > > I get the hours, minutes and seconds. Is there a way to extend this so that > I get the milliseconds too? > > Thanks, > Don > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    If you are looking for milliseconds on the current time, see the examples on microtime(): http://www.php.net/manual/en/function.microtime.php

    Here is a summary of how to get milliseconds:

    list($usec, $sec) = explode(" ",microtime()); $milliseconds = (((float)$usec/1000) + (float)$sec);

    I haven't tested this out, but it looks right.

    Michael "phpzen" Richardson

    -----Original Message----- From: DonPro [mailto:donprolclcan.com] Sent: Wednesday, September 04, 2002 11:47 AM To: php list Subject: [PHP] How do I get milliseconds?

    Using the following code,

    date("His")

    I get the hours, minutes and seconds. Is there a way to extend this so that I get the milliseconds too?

    Thanks, Don

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

    attached mail follows:


    I don't know how to work with XML... I know that it's a good standard to pass information between computer or applications, but I don't know how to separe my data from my presentation on my PHP projects.

    I always use OOP, I organize all the data in databases and clases, but I always have to put some code on my presentation files, like index.php, viewstock.php, and it will be great if I can organize my projects so the presentation can be handled by any designersm, at this time I always have to make the changes on the presentation files because I am the one who know about PHP.

    Can you give some example about how to separate the data from the presentation using XML and databases? Or can you tell me about a project where I can see it?

    Thank you.

    attached mail follows:


    Rodrigo Dominguez wrote:

    >I don't know how to work with XML... I know that it's a good standard to >pass information between computer or applications, but I don't know how to >separe my data from my presentation on my PHP projects. > >I always use OOP, I organize all the data in databases and clases, but I >always have to put some code on my presentation files, like index.php, >viewstock.php, and it will be great if I can organize my projects so the >presentation can be handled by any designersm, at this time I always have to >make the changes on the presentation files because I am the one who know >about PHP. > >Can you give some example about how to separate the data from the >presentation using XML and databases? Or can you tell me about a project >where I can see it? > >Thank you. > > > 1. Convert sql queries into xml (I'm glad to send a copy of my class if you'd like) basically its: A. Loop over query as you normally would B. Loop through each column in a record for a query and make an xml compatible string like: <record> <fieldname> value </fieldname> </record> 2. Then just follow the xslt section of the php manual it's pretty straight forward

    Give it a shot, if you have trouble send specific questions to the list I and quite a few other will be glad to help

    attached mail follows:


    Forgot a step: (1C) make an xslt stylesheet which is basically just a beefed-up html page. Check out devshed.cm xml.com and w3c.org for info on xslt stlyesheets

    Geoff Hankerson wrote:

    > Rodrigo Dominguez wrote: > >> I don't know how to work with XML... I know that it's a good standard to >> pass information between computer or applications, but I don't know >> how to >> separe my data from my presentation on my PHP projects. >> >> I always use OOP, I organize all the data in databases and clases, but I >> always have to put some code on my presentation files, like index.php, >> viewstock.php, and it will be great if I can organize my projects so the >> presentation can be handled by any designersm, at this time I always >> have to >> make the changes on the presentation files because I am the one who know >> about PHP. >> >> Can you give some example about how to separate the data from the >> presentation using XML and databases? Or can you tell me about a project >> where I can see it? >> >> Thank you. >> >> >> > 1. Convert sql queries into xml (I'm glad to send a copy of my class > if you'd like) > basically its: > A. Loop over query as you normally would > B. Loop through each column in a record for a query and make an xml > compatible string like: > <record> > <fieldname> value </fieldname> > </record> > 2. Then just follow the xslt section of the php manual it's pretty > straight forward > > Give it a shot, if you have trouble send specific questions to the > list I and quite a few other will be glad to help >

    attached mail follows:


    Ok, thank you.... just one more doubt Is it threading safe?

    For example: At 13:30:10 [Proccess 1] cliente request index.php At 13:30:11 [Proccess 1] index.php is putting the content of the querey into index.xml At 13:30:12 [Proccess 2]a new client request index.php At 13:30:13 [Proccess 2]a new instance of index.php is invoked and it starts to put the content of the query into index.xml, but [Proccess 1] is still working with index.xml

    What happends?

    "Geoff Hankerson" <ghankmillerdavis.com> escribió en el mensaje news:3D765AEC.2040701millerdavis.com... > Forgot a step: (1C) make an xslt stylesheet which is basically just a > beefed-up html page. > Check out devshed.cm > xml.com > and w3c.org for info on xslt stlyesheets > > Geoff Hankerson wrote: > > > Rodrigo Dominguez wrote: > > > >> I don't know how to work with XML... I know that it's a good standard to > >> pass information between computer or applications, but I don't know > >> how to > >> separe my data from my presentation on my PHP projects. > >> > >> I always use OOP, I organize all the data in databases and clases, but I > >> always have to put some code on my presentation files, like index.php, > >> viewstock.php, and it will be great if I can organize my projects so the > >> presentation can be handled by any designersm, at this time I always > >> have to > >> make the changes on the presentation files because I am the one who know > >> about PHP. > >> > >> Can you give some example about how to separate the data from the > >> presentation using XML and databases? Or can you tell me about a project > >> where I can see it? > >> > >> Thank you. > >> > >> > >> > > 1. Convert sql queries into xml (I'm glad to send a copy of my class > > if you'd like) > > basically its: > > A. Loop over query as you normally would > > B. Loop through each column in a record for a query and make an xml > > compatible string like: > > <record> > > <fieldname> value </fieldname> > > </record> > > 2. Then just follow the xslt section of the php manual it's pretty > > straight forward > > > > Give it a shot, if you have trouble send specific questions to the > > list I and quite a few other will be glad to help > > > > >

    attached mail follows:


    what would be the best, most efficient way to print something every three times a loop runs

    for ($i=0; $i<$num_products; $i++) { echo "something"; }

    this happens every time it runs and has to stay that way but every three times i want to print additional info.

    Any help appreciated.

    attached mail follows:


    add the following:

    if( $i % 3 == 0 ) { print("something else"); }

    You might need to vary the zero in that equation to get it to print at the "right time" by which I mean, the above will print "something else" on the first iteration of the below loop.

    -philip

    On Wed, 4 Sep 2002, Cirkit Braker wrote:

    > what would be the best, most efficient way to print something every three > times a loop runs > > for ($i=0; $i<$num_products; $i++) > { > echo "something"; > } > > this happens every time it runs and has to stay that way but every three > times i want to print additional info. > > Any help appreciated. > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    Inside the loop do:

    if(!($i%3)) { whatever }

    -Rasmus

    On Wed, 4 Sep 2002, Cirkit Braker wrote:

    > what would be the best, most efficient way to print something every three > times a loop runs > > for ($i=0; $i<$num_products; $i++) > { > echo "something"; > } > > this happens every time it runs and has to stay that way but every three > times i want to print additional info. > > Any help appreciated. > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    if ($i%3 = 0) { echo "something"; }

    On Wed, 4 Sep 2002, Cirkit Braker wrote:

    > what would be the best, most efficient way to print something every three > times a loop runs > > for ($i=0; $i<$num_products; $i++) > { > echo "something"; > } > > this happens every time it runs and has to stay that way but every three > times i want to print additional info. > > Any help appreciated. > > > >

    attached mail follows:


    Hi,

    On every loop, just put the text you want to add to a variable. like if($i == 0) echo "first print"; elseif($i == 1) echo "second"; elseif($i == 2) echo "third"; etc...

    --
    

    Nicos - CHAILLAN Nicolas nicosphp.net www.WorldAKT.com - Hébergement de sites Internet

    "Cirkit Braker" <cirkitbrakerhotmail.com> a écrit dans le message de news: 20020904190200.6836.qmailpb1.pair.com... > what would be the best, most efficient way to print something every three > times a loop runs > > for ($i=0; $i<$num_products; $i++) > { > echo "something"; > } > > this happens every time it runs and has to stay that way but every three > times i want to print additional info. > > Any help appreciated. > >

    attached mail follows:


    Sorry I hadn't read well, yes use if(!($i %3)) echo "lala";

    --
    

    Nicos - CHAILLAN Nicolas nicosphp.net www.WorldAKT.com - Hébergement de sites Internet

    <nicosphp.net> a écrit dans le message de news: 20020904190647.17220.qmailpb1.pair.com... > Hi, > > On every loop, just put the text you want to add to a variable. > like > if($i == 0) echo "first print"; > elseif($i == 1) echo "second"; > elseif($i == 2) echo "third"; etc... > > -- > > Nicos - CHAILLAN Nicolas > nicosphp.net > www.WorldAKT.com - Hébergement de sites Internet > > "Cirkit Braker" <cirkitbrakerhotmail.com> a écrit dans le message de news: > 20020904190200.6836.qmailpb1.pair.com... > > what would be the best, most efficient way to print something every three > > times a loop runs > > > > for ($i=0; $i<$num_products; $i++) > > { > > echo "something"; > > } > > > > this happens every time it runs and has to stay that way but every three > > times i want to print additional info. > > > > Any help appreciated. > > > > > >

    attached mail follows:


    Hello, From reading the docs on XML functions for PHP, I understand that validation is not included. Does any one know where there is a package for PHP that is already developed or resources where I can learn how to do this myself? Thank you. -Samuel

    attached mail follows:


    I'm trying to retrieve information from an NDS server using LDAP functions in PHP 4.06. I am able to establish the connection and bind to the server using an anonymous bind, but when I try to bind as a valid user, the app seems to run in an infinite loop. I'm not sure where to look for the cause of this problem. Any suggestions would be appreciated.

    Thanks in advance,

    Brad

    attached mail follows:


    I am using

    substr("$f", 0, 1);

    to get the first character of a string but what to be able to tell if the first character is a digit or a letter is there a way to do this?

    attached mail follows:


    is_int($f) will return true if $f is an integer, false otherwise.

    Check http://www.php.net/manual/en/function.is-int.php

    HTH, Steve.

    -----Original Message----- From: Fifield, Mike [mailto:Mike.Fifieldschwab.com] Sent: Wednesday, September 04, 2002 4:04 PM To: php-generallists.php.net Subject: [PHP] check for a number

    I am using

    substr("$f", 0, 1);

    to get the first character of a string but what to be able to tell if the first character is a digit or a letter is there a way to do this?

    attached mail follows:


    > I am using > substr("$f", 0, 1); > to get the first character of a string but what to be able to tell if > the first character is a digit or a letter is there a way to do this?

    ereg( "^[0-9]", $f )

    will let you know if the first character is a digit or not...

    Chris

    attached mail follows:


    Hi,

    if(is_numeric($return = substr("$f", 0, 1))) etc... You can look at the manual to get the list of the is_() functions: is_array is_bool is_callable is_double is_float is_int is_integer is_long is_null is_numeric is_object is_real is_resource is_scalar is_string etc.

    --
    

    Nicos - CHAILLAN Nicolas nicosphp.net www.WorldAKT.com - Hébergement de sites Internet

    "Mike Fifield" <Mike.Fifieldschwab.com> a écrit dans le message de news: FFE9B7BE532CD411872F00508BDFB8FE0EB76CA0n6010vmx.nt.schwab.com... > I am using > > substr("$f", 0, 1); > > to get the first character of a string but what to be able to tell if the > first character is a digit or a letter is there a way to do this? > > > > > >

    begin 666 box-0.gif M1TE&.#EA"P`'`(#_`,# P ```"'Y! $`````+ `````+``<`0 (-A(\6FAK? )HI0+U/1*`[ ` end

    begin 666 box-1.gif M1TE&.#EA"P`'`(#_`,# P ```"'Y! $`````+ `````+``<`0 (,A(\6&ZGL (HI2LN>H*`#L` ` end

    attached mail follows:


    Hi, What is the necessary code to return a recordset from a single text box with more than one keyword in it (like most search engines do)? Thanks

    attached mail follows:


    Jason wrote: > > Hi, > What is the necessary code to return a recordset from a single text box with > more than one keyword in it (like most search engines do)? > Thanks

    This is basic, and syntax is not checked...

    if( is_array( ($words = split( '[[:space:]]+', $GET['keywordInput'] )) ) && count( $words ) > 0 ) { // // Initialize query. // $qString = 'SELECT xx, yy, .. FROM foo_table ' .'WHERE ';

    // // Create condition clause from word list. // foreach( $words as $word ) { $qString .= "zz LIKE '%".addSlashes( $word )."% AND "; }

    // // Trim the extraneous AND. // $qString = substr( $qString, whatever goes here to trim AND );

    // // Perform query. // }

    -- 
    .-----------------.
    | Robert Cummings |
    :-----------------`----------------------------.
    | Webdeployer - Chief PHP and Java Programmer  |
    :----------------------------------------------:
    | Mail  : mailto:robert.cummingswebmotion.com |
    | Phone : (613) 731-4046 x.109                 |
    :----------------------------------------------:
    | Website : http://www.webmotion.com           |
    | Fax     : (613) 260-9545                     |
    `----------------------------------------------'
    

    attached mail follows:


    Hi Javier,

    I think parsing the listing into a multidemensional array is the answer. But actually, I do not yet know how that would look like in PHP. But I can give you an example of how it is done in ActionScript (Ecmascript).

    file_arr[n] = [name, date]

    Now you can sort file_arr by file_arr[n][0] (name) or file_arr[n][1] (date).

    Hope it helps, Timo

    Am Dienstag den, 3. September 2002, um 12:27, schrieb Javier Montserat:

    > i have the following code which reads a list of files from a > directory - > > $listcmd = "ls " .$dirPath; > $temp = exec($listcmd, $listoffiles, $status); > if($status == 0) { > for ($i =0; $i < sizeof($listoffiles); $i++) { > $this->fileName[$i] = $listoffiles[$i]; > $this->sizeofFile[$i] = sprintf("%01.2f", > (filesize($dirPath."/".$listoffiles[$i])/1024)/1024); > $this->fileDate[$i] = date("d-M-y H:i", > filemtime($dirPath."/".$listoffiles[$i])); > } > $this->displayFiles(); > > What I want to do is display the files sorted by date. > > Okay, so I've just realised that the really easy way to do this > is by adding -St (sort by time) to the ls command... > > $listcmd = "ls -St " .$dirPath; > > But how could this be achieved by sorting the three arrays? > What if I alternately wanted to sort the files by name, size or > date without re-reading the directory each time? > > Would an associative array structure be better suited to this > type of operation? > > Thanks for your insight, > > Javier > > _________________________________________________________________ > Chat with friends online, try MSN Messenger: http://messenger.msn.com > > > -- PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    Hi Victor,

    the error code (you are currently suppressing) should give you some directions.

    Timo

    attached mail follows:


    Hi Electroteque,

    Am Dienstag den, 3. September 2002, um 10:14, schrieb Bas Jobsen: >> hi there i was wondering if there was a way to limit the >> ammount of items >> in a loop to execute sleep then execute the rest of the items >> to prevent >> server load ? > > for($i=0;.......) > { > if($i>0&&$i%100==0)sleep(10); > }

    I think

    for($i=0; $i<100;$i++){ // do something sleep(1); };

    makes more sense.

    If that is already to much sleep:

    $sleepinterval = 10; $s = $sleepinterval; for ($i=0; $i<100;$i++) { // do something if (!$s--) {sleep(1);$s = $sleepinterval;}; };

    On every 10th (or whatever you define as $sleepinterval) iteration, the interpreter will sleep for a second.

    But this still aint a sophisticated load balancing :-)

    Timo

    attached mail follows:


    Hi!

    For those Windows users who are interested in a useable help system, the 9th sample of our new CHM edition is out at http://weblabor.hu/php-doc-chm

    It includes a workaround for the most annoying IE6 bug we ever met (thanks to Brendan for the tips!), and also simplifies skin switching.

    For those who beta tested the sample, this is the same file, no need to download it again.

    Goba

    attached mail follows:


    I have a form that posts to another php file. But it won't display the var? It just shows a blank screen.

    For example

    test.php has form input name test2.php prints name

    On test2.php it shows a blank screen, but if I assign $name on test2.php and reload, it will print the var. Is there something in the php.ini that I have to change to get vars to post? or some setting somewhere else?

    -Matt

    -- 
    Matt Zur
    mattzzurnet.com
    http://www.zurnet.com
    

    Need a Web Site??? - Visit... www.zurnet.com

    1997 - 2002 - 5th Anniversary!!!

    attached mail follows:


    If you have register globals off, you must use $_POST['name'] and not $name. Check your php.ini (<? phpinfo(); ?>)

    --
    

    Nicos - CHAILLAN Nicolas nicosphp.net www.WorldAKT.com - Hébergement de sites Internet

    "Matt Zur" <mattzzurnet.com> a écrit dans le message de news: 3D7682A5.1070604zurnet.com... > I have a form that posts to another php file. But it won't display the > var? It just shows a blank screen. > > For example > > test.php has form input name > test2.php prints name > > On test2.php it shows a blank screen, but if I assign $name on test2.php > and reload, it will print the var. Is there something in the php.ini > that I have to change to get vars to post? or some setting somewhere else? > > -Matt > > > > -- > Matt Zur > mattzzurnet.com > http://www.zurnet.com > > Need a Web Site??? - Visit... www.zurnet.com > > 1997 - 2002 - 5th Anniversary!!! >