OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
From: php-general-digest-helplists.php.net
Date: Wed Jan 09 2002 - 11:09:19 CST

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

    php-general Digest 9 Jan 2002 17:09:19 -0000 Issue 1101

    Topics (messages 79860 through 79933):

    echo "" problem NEW
            79860 by: universal2001
            79866 by: Steven Cayford
            79869 by: Necro
            79871 by: CC Zona
            79872 by: Steve Maroney
            79898 by: Henning Sprang
            79901 by: Nicolas Costes
            79902 by: Henning Sprang
            79903 by: Nicolas Costes
            79905 by: Bas van Rooijen

    inserting a file into MSSQL
            79861 by: Peter Lavender
            79914 by: Jimmy

    Re: Apache virtualhosts with different user
            79862 by: Philip Hallstrom

    Apache and PHP under win98 help !
            79863 by: Lindsey

    Time
            79864 by: Necro
            79865 by: Martin Towell

    serial array vs. hash....
            79867 by: Eric McKeown

    Cyrus IMAP 4.0.16 TAR error
            79868 by: gaukia 345
            79875 by: Maciej Uhlig

    globals not working for me with 4.1.0
            79870 by: Matt Pieklik

    foreach statement
            79873 by: Chris Grigor
            79874 by: Niklas Lampén
            79876 by: Chris Grigor
            79877 by: David Balatero
            79878 by: Niklas Lampén
            79880 by: Chris Grigor
            79881 by: Niklas Lampén

    Re: curl questionnaire!
            79879 by: Sterling Hughes

    binary data - MSSQL
            79882 by: Peter Lavender
            79895 by: Henning Sprang
            79900 by: Daniel Masur

    Re: IP address from which country
            79883 by: Jon Farmer
            79884 by: Dimitris Kossikidis
            79889 by: Eugene Lee

    PHP Security Extension
            79885 by: List Client

    Re: CC Processing in PHP
            79886 by: gurix

    Re: I am very new Question
            79887 by: gurix

    Re: bcc
            79888 by: gurix

    this is a test. Plz ignore.
            79890 by: fabrizio

    unshift a key value pair
            79891 by: Marc Logghe
            79892 by: Andrey Hristov
            79894 by: Marc Logghe
            79896 by: CC Zona
            79897 by: Marc Logghe

    PHP env variables... ?
            79893 by: fabrizio

    sessions, PHPSESSID, cookies
            79899 by: gkin

    Problem "input in flex scanner failed"
            79904 by: Pavel Kharitonov

    Re: Including files & variables ...
            79906 by: Bas van Rooijen

    Regex question
            79907 by: Jon Haworth
            79912 by: Stefan Rusterholz
            79913 by: Jon Haworth
            79915 by: Stefan Rusterholz
            79924 by: Jon Haworth

    Sessions don't load
            79908 by: Ryan Kelley
            79911 by: Andrey Hristov

    PHP vs. ASP
            79909 by: Jake
            79910 by: Julio Nobrega Trabalhando
            79917 by: Robert Klinkenberg
            79918 by: Dean Ouellette
            79921 by: Michael Kimsal
            79922 by: Michael Kimsal
            79929 by: Nicolas Costes
            79931 by: Philip Hallstrom

    php & sockets!- urg!!!
            79916 by: Sandeep Murphy

    Re: Sessions
            79919 by: Johnson, Kirk

    Newbie
            79920 by: Kevin P
            79926 by: Julio Nobrega Trabalhando

    Upcoming PHP Training course - info
            79923 by: Michael Kimsal

    php,sockets-help!
            79925 by: Sandeep Murphy
            79927 by: Andrey Hristov
            79928 by: Bogdan Stancescu

    postgres
            79930 by: aurelio
            79932 by: Dave

    Re: problems with urlencoding
            79933 by: V

    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:


    Hi again!

    Thanks for the reply!

    I still have another question:

    I want to create a recycleable code by printing a set of html code which I
    copied and paste from my html edittor.

    however because there are lots of quotation marks on the html code it result
    an error page.

    here is part of the html code:
    <table border="0" cellpadding="0" cellspacing="0" width="639">
      <tr>
        <td><img src="img_heading/spacer.gif" width="25" height="1"
    border="0"></td>
      </tr>
      <tr>
        <td colspan="11"><img name="index_r1_c1"
    src="img_heading/index_r1_c1.gif" width="639" height="5" border="0"></td>
        <td><img src="img_heading/spacer.gif" width="1" height="5"
    border="0"></td>
      </tr>
      <tr>
        <td rowspan="5"><img name="index_r2_c1"
    src="img_heading/index_r2_c1.gif" width="25" height="43" border="0"></td>
    </table> ...etc

    so I tired to use (echo) like this:

    echo "<table border="0" cellpadding="0" cellspacing="0" width="639">
      <tr>
        <td><img src="img_heading/spacer.gif" width="25" height="1"
    border="0"></td>
      </tr>
      <tr>
        <td colspan="11"><img name="index_r1_c1"
    src="img_heading/index_r1_c1.gif" width="639" height="5" border="0"></td>
        <td><img src="img_heading/spacer.gif" width="1" height="5"
    border="0"></td>
      </tr>
      <tr>
        <td rowspan="5"><img name="index_r2_c1"
    src="img_heading/index_r2_c1.gif" width="25" height="43" border="0"></td>
    </table>";
    but it DOES NOT WORK.
    How do I get way with all of the quotation marks????

    thank for all the help.

    Dani

    attached mail follows:


    On 2002.01.09 02:00:55 -0600 universal2001 wrote:

    > so I tired to use (echo) like this:
    >
    > echo "<table border="0" cellpadding="0" cellspacing="0" width="639">
    > <tr>
    > <td><img src="img_heading/spacer.gif" width="25" height="1"
    > border="0"></td>
    > </tr>
    > <tr>
    > <td colspan="11"><img name="index_r1_c1"
    > src="img_heading/index_r1_c1.gif" width="639" height="5" border="0"></td>
    > <td><img src="img_heading/spacer.gif" width="1" height="5"
    > border="0"></td>
    > </tr>
    > <tr>
    > <td rowspan="5"><img name="index_r2_c1"
    > src="img_heading/index_r2_c1.gif" width="25" height="43" border="0"></td>

    Try to think like a computer program. It sees the command:
    echo "<table border="
    followed by a (meaningless to it) 0 and more quoted text, and another 0,
    etc...

    The first and last quotes are really part of your command to php, the
    others should be treated as harmless text and passed on to the browser as
    part of your html. You can tell php to treat quotes as text by escaping
    them: putting a \ in front of them like this:

    echo "<table border=\"0\">";

    Or you could drop out of php mode entirely to do your html like this:

    <?php
    ...php stuff here ...
    ?>

    <table border="0">

    <?php
    ...more php stuff...
    ?>

    One of these methods should get you going.

    -Steve

    attached mail follows:


    Use the \ escape character.
    echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"
    width=\"639\">\n";
    ."<tr>\n";
    ."<td>\n";
    ."<img src=\"img_heading/spacer.gif\" width=\"25\" height=\"1\"
    border=\"0\">\n";
    ."</td>\n"

    Use the . to add to echo to make the code easier to manage.
    Use \n to take a newline in html so that the source code is easy to read
    once you view it from a browser.
    Just make sure at the end of your last addition line with . that you end the
    line with a ;

    E.g your last line would be
    ."</table>\n";

    That should help you.

    Andrew Duck

    -----Original Message-----
    From: universal2001 [mailto:universal2001iprimus.com.au]
    Sent: Wednesday, 9 January 2002 7:01 PM
    To: php-generallists.php.net
    Subject: [PHP] echo "" problem NEW
    Importance: High

    Hi again!

    Thanks for the reply!

    I still have another question:

    I want to create a recycleable code by printing a set of html code which I
    copied and paste from my html edittor.

    however because there are lots of quotation marks on the html code it result
    an error page.

    here is part of the html code:
    <table border="0" cellpadding="0" cellspacing="0" width="639">
      <tr>
        <td><img src="img_heading/spacer.gif" width="25" height="1"
    border="0"></td>
      </tr>
      <tr>
        <td colspan="11"><img name="index_r1_c1"
    src="img_heading/index_r1_c1.gif" width="639" height="5" border="0"></td>
        <td><img src="img_heading/spacer.gif" width="1" height="5"
    border="0"></td>
      </tr>
      <tr>
        <td rowspan="5"><img name="index_r2_c1"
    src="img_heading/index_r2_c1.gif" width="25" height="43" border="0"></td>
    </table> ...etc

    so I tired to use (echo) like this:

    echo "<table border="0" cellpadding="0" cellspacing="0" width="639">
      <tr>
        <td><img src="img_heading/spacer.gif" width="25" height="1"
    border="0"></td>
      </tr>
      <tr>
        <td colspan="11"><img name="index_r1_c1"
    src="img_heading/index_r1_c1.gif" width="639" height="5" border="0"></td>
        <td><img src="img_heading/spacer.gif" width="1" height="5"
    border="0"></td>
      </tr>
      <tr>
        <td rowspan="5"><img name="index_r2_c1"
    src="img_heading/index_r2_c1.gif" width="25" height="43" border="0"></td>
    </table>";
    but it DOES NOT WORK.
    How do I get way with all of the quotation marks????

    thank for all the help.

    Dani

    attached mail follows:


    In article <20020108234308.A4511isaiah.dafarafet.net>,
     scayfordtds.net (Steven Cayford) wrote:

    > You can tell php to treat quotes as text by escaping
    > them: putting a \ in front of them like this:
    >
    > echo "<table border=\"0\">";
    >
    > Or you could drop out of php mode entirely to do your html like this:
    >
    > <?php
    > ...php stuff here ...
    > ?>
    >
    > <table border="0">
    >
    > <?php
    > ...more php stuff...
    > ?>
    >
    > One of these methods should get you going.

    There's also the heredoc option (variable interpolation, no need to escape
    of quotes, no jumping back and forth between PHP mode and HTML mode)
    <http://www.php.net/manual/language.types.string.php>:

    echo<<<EOF;
    <table border="$bordersize">
       <tr>
       <td>$mycontent</td>
       <tr>
    </table>

    <style type="text/css">
    .$classname { margin: 10px; background-color: black; color: white; }
    </style>

     <p class="$classname">Blah blah...</p>
    EOF;

    -- 
    CC
    

    attached mail follows:


    I simply use single quotes for html and double quotes for PHP.

    echo "<table border='1' cellpadding='0' cellspacing='0' width='620'>";

    works for me.

    Steve

    On Tue, 8 Jan 2002, Steven Cayford wrote:

    > On 2002.01.09 02:00:55 -0600 universal2001 wrote: > > > so I tired to use (echo) like this: > > > > echo "<table border="0" cellpadding="0" cellspacing="0" width="639"> > > <tr> > > <td><img src="img_heading/spacer.gif" width="25" height="1" > > border="0"></td> > > </tr> > > <tr> > > <td colspan="11"><img name="index_r1_c1" > > src="img_heading/index_r1_c1.gif" width="639" height="5" border="0"></td> > > <td><img src="img_heading/spacer.gif" width="1" height="5" > > border="0"></td> > > </tr> > > <tr> > > <td rowspan="5"><img name="index_r2_c1" > > src="img_heading/index_r2_c1.gif" width="25" height="43" border="0"></td> > > Try to think like a computer program. It sees the command: > echo "<table border=" > followed by a (meaningless to it) 0 and more quoted text, and another 0, > etc... > > The first and last quotes are really part of your command to php, the > others should be treated as harmless text and passed on to the browser as > part of your html. You can tell php to treat quotes as text by escaping > them: putting a \ in front of them like this: > > echo "<table border=\"0\">"; > > Or you could drop out of php mode entirely to do your html like this: > > <?php > ...php stuff here ... > ?> > > <table border="0"> > > <?php > ...more php stuff... > ?> > > One of these methods should get you going. > > -Steve > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net > >

    Thank you, Steve Maroney

    attached mail follows:


    Hy,

    universal2001 wrote:

    > Hi again! > > Thanks for the reply! > > I still have another question:

    > > so I tired to use (echo) like this: > > echo "<table border="0" cellpadding="0" cellspacing="0" width="639"> > <tr> > <td><img src="img_heading/spacer.gif" width="25" height="1" > border="0"></td> > </tr> > <tr> > <td colspan="11"><img name="index_r1_c1" > src="img_heading/index_r1_c1.gif" width="639" height="5" border="0"></td> > <td><img src="img_heading/spacer.gif" width="1" height="5" > border="0"></td> > </tr> > <tr> > <td rowspan="5"><img name="index_r2_c1" > src="img_heading/index_r2_c1.gif" width="25" height="43" border="0"></td> > </table>"; > but it DOES NOT WORK. > How do I get way with all of the quotation marks????

    1) you can escape each double quote with a backslash, the first line of your thing woulkd then look like

    echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"639\">

    and so on

    2) if you don't want this by any reason, you can use single quotes to mark the text you want to print out like in

    echo '<table width="100%">';

    the difference is that with single quotes you will _not_ be able to use variable replacement in between the quotes, something like

    <? $myvar=100; echo "<table width=\"$myvar\">"; ?>

    will output

    <table width="100%">

    while this:

    <? $myvar=100; echo '<table width="$myvar">'; ?>

    will output exactly

    <table width="$myvar">

    hth, henning

    attached mail follows:


    Hellorghh !!! You'd better do like this :

    echo "<table border='0' cellpadding='0' cellspacing='0' width='639'>

    Le Mercredi 9 Janvier 2002 13:05, Henning Sprang a écrit : > Hy, > > universal2001 wrote: > > Hi again! > > > > Thanks for the reply! > > > > I still have another question: > > > > > > so I tired to use (echo) like this: > > > > echo "<table border="0" cellpadding="0" cellspacing="0" width="639"> > > <tr> > > <td><img src="img_heading/spacer.gif" width="25" height="1" > > border="0"></td> > > </tr> > > <tr> > > <td colspan="11"><img name="index_r1_c1" > > src="img_heading/index_r1_c1.gif" width="639" height="5" border="0"></td> > > <td><img src="img_heading/spacer.gif" width="1" height="5" > > border="0"></td> > > </tr> > > <tr> > > <td rowspan="5"><img name="index_r2_c1" > > src="img_heading/index_r2_c1.gif" width="25" height="43" border="0"></td> > > </table>"; > > but it DOES NOT WORK. > > How do I get way with all of the quotation marks???? > > 1) you can escape each double quote with a backslash, > the first line of your thing woulkd then look like > > echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" > width=\"639\"> > > and so on > > 2) if you don't want this by any reason, you can use single quotes to > mark the text you want to print out like in > > echo '<table width="100%">'; > > the difference is that with single quotes you will _not_ be able to use > variable replacement in between the quotes, something like > > <? > $myvar=100; > echo "<table width=\"$myvar\">"; > ?> > > will output > > <table width="100%"> > > > while this: > > <? > $myvar=100; > echo '<table width="$myvar">'; > ?> > > will output exactly > > <table width="$myvar"> > > > hth, > henning

    -- 
     ( * >    Nicolas Costes,
     //\\      IUT de La Roche / Yon
    ( \/ )     Naycolaroche.univ-nantes.fr
     < <      http://luxregina.free.fr
    

    attached mail follows:


    Nicolas Costes wrote:

    > Hellorghh !!! > You'd better do like this : > > echo "<table border='0' cellpadding='0' cellspacing='0' width='639'>

    >

    just another one - but i am too out of practice with html standarts to know if this is compliant ( a browser showing a result doesn't neccessary mean it's standarts compliant!)

    henning

    attached mail follows:


    Yes, you're right !!!

    some browsers like IE will accept even <blah blah=0>, <blah blah='0'>, <blah blah="0">, and some like Opera will only understand : <IE SuxWithTooEasySyntax="1"> ;-))

    Le Mercredi 9 Janvier 2002 14:17, Henning Sprang a écrit : > Nicolas Costes wrote:

    -- 
     ( * >    Nicolas Costes,
     //\\      IUT de La Roche / Yon
    ( \/ )     Naycolaroche.univ-nantes.fr
     < <      http://luxregina.free.fr
    

    attached mail follows:


    Hello,

    In addition to Henning Sprang's fine solutions, you can also do the following (given you use PHP 4);

    <? $xmp_width = 5; $xmp_tdcolor = "#FF0000"; $xmp_text = "Some text";

    echo <<<EOF

    <TABLE WIDTH="{$xmp_width}"> <TR><TD COLOR="{$xmp_tdcolor}">$xmp_text</TD></TR> </TABLE>

    EOF; ?>

    Note that the {} around your variables are optional, they will not be included in the output but can be used to avoid confusion.

    greets,

    bvr.

    On Wed, 9 Jan 2002 15:00:55 +0700, universal2001 wrote:

    >Hi again! > >Thanks for the reply! > >I still have another question: > >I want to create a recycleable code by printing a set of html code which I >copied and paste from my html edittor. > >however because there are lots of quotation marks on the html code it result >an error page.

    attached mail follows:


    Sorry to post twice, I should have said that I'm using php 4.1.11.

    A PEAR example would be even better :)

    > Hi everyone, > > Does anyone have a link to a good reference on how to insert a binary file > (zip file) into MSSQL? > > I've got the upload and stuff working, just a bit unsure about how I'm now > going to put the file(it's been moved) into the database itself. The > datatype I have used is Image, but most of the examples I have seen have > used text or some similar to store the file. > > Thanks, > > Pete >

    attached mail follows:


    Hi Peter,

    > Does anyone have a link to a good reference on how to insert a binary file > (zip file) into MSSQL?

    why do you want to store binary file in DB? It's more efficient to store the file in filesystem, and in DB only store the path of the file. Unless you really have a good reason and left with no option other than store the file in DB.

    --
    Jimmy
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Brigands will demand your money or your life, but a woman will demand both.
    

    attached mail follows:


    You could also run separate instances of the httpd binary with different configs telling them what ip/port to bind/listen to...then run the server as that user...

    not very efficient for a lot of users, but it would work for a small set.

    On Wed, 9 Jan 2002, Rich Buggy wrote:

    > > > if I define 'user' in virtualhost section of apache's httpd.conf, then my > > cgi scripts will be running as 'user' if suexec has been set up correctly. > > It's okay. But how can I tell apache to run the whole virtualhost as > > 'user'? Including accessing html files, and especially php. > > In 1.3 you can't. Last I heard version 2 was supposed to include something > that would let you do this. > > > Is it possible somehow? Having read the apache docs, I haven't found > > anything useful, but there must be a solution if I don't want my users to > > run php scripts as www-data. > > Run PHP as a cgi instead of a module. The PHP docs tell you how > > Rich > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net >

    attached mail follows:


    Hi, Please check the link below, this site explains to you in clear details how to install and configure php and apache on windows 98. I have tried it and it works.

    http://internetmaster.com/installtutorial/install.htm

    I hope that this will be helpfull to you.

    Lindsey

    attached mail follows:


    How can I make a variable which is the current time + 48 hrs??

    I had $replyby = time() + 172800; But that returns time in seconds. How can I then format that $replyto into day month year, HH:MM:SS ??

    Andrew Duck

    attached mail follows:


    date("d M Y, H:i:s", $replyby);

    -----Original Message----- From: Necro [mailto:necroexclusionzone.com] Sent: Wednesday, January 09, 2002 4:27 PM To: php-generallists.php.net Subject: [PHP] Time

    How can I make a variable which is the current time + 48 hrs??

    I had $replyby = time() + 172800; But that returns time in seconds. How can I then format that $replyto into day month year, HH:MM:SS ??

    Andrew Duck

    -- 
    PHP General Mailing List (http://www.php.net/)
    To unsubscribe, e-mail: php-general-unsubscribelists.php.net
    For additional commands, e-mail: php-general-helplists.php.net
    To contact the list administrators, e-mail: php-list-adminlists.php.net
    

    attached mail follows:


    Hi folks,

    Quick question about the performance implications of looking up info in a hash (associative array) vs. looking it up in a serial array. I have a script that will be running a function (actually several similar functions) up to 1500 times to verify that certain data values are in a valid list. My list might have anywhere from 2 to 100 valid values. I could store the list in a conventional serial array...

    $valid[0] = "Valid One"; $valid[1] = "Valid Two"; $valid[2] = "Valid Three"; . and so on, and then use a for loop to iterate through the contents of the array each time that I need to check to see if I have a valid value. On the other hand, I could create a hash that looks like...

    $valid["Valid One"] = "some value"; $valid["Valid Two"] = "some other value";

    and so on, and then simply check to see if the entry exists in the associative array in order to determine whether it is valid. I suspect that the latter method would be much more efficient, and I intend to test the two techniques myself to find out, but I just thought I would check here to see if anyone could confirm or refute my hunch....

    Thanks for your help,

    Eric

    attached mail follows:


    I downloaded Aeromail from freshmeat.net. It needed an IMAP server. So I went to ftp.andrew.cmu.edu to get Cyrus IMAP 4.0.16. I unpacked it using TAR but there're some errors including CRC. I downloaded again and re-tried. Same error. Don't know what to do because the FTP site is the official project home and there's nothing in their mail list that have similar complains to mine. Any ideas?

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

    attached mail follows:


    > -----Original Message----- > From: gaukia 345 [mailto:gaukiahotmail.com] > Sent: Wednesday, January 09, 2002 6:00 AM > To: php-generallists.php.net > Subject: [PHP] Cyrus IMAP 4.0.16 TAR error > > > I downloaded Aeromail from freshmeat.net. It needed an IMAP server. So I > went to ftp.andrew.cmu.edu to get Cyrus IMAP 4.0.16. I unpacked > it using TAR

    you mean cyrus-imapd-2.0.16.tar.gz, right? it unpacks correctly...

    > but there're some errors including CRC. I downloaded again and re-tried. > Same error. Don't know what to do because the FTP site is the official > project home and there's nothing in their mail list that have similar > complains to mine. Any ideas?

    did you transfer it in ascii mode perhaps :-) if so, try ftp binary mode.

    Maciek

    attached mail follows:


    Hello, I had a script that was workin for me with PHP 4.0.6. I upgraded to 4.1.0 because another app required it, and it broke the original script I was using. Under 4.0.6 I was able to do the following:

    global $PHP_AUTH_USER,$PHP_AUTH_PW; echo $GLOBALS[REMOTE_ADDR];

    This would echo the correct results. Now after the upgrade, the code above does not echo anything. This will work, however: echo $_SERVER["REMOTE_ADDR"];

    In my php.ini I have the following: register_globals = On register_argc_argv = On

    Any ideas on how to fix these global variables not being set?

    Thanks, Matt

    attached mail follows:


    Okay lets see who has there thinking caps on today (cos I really dont)

    I have a list of email addresses stored in a text file.

    I am able to run the script and get all the mail addresses in the list mailed but thats all in one mail. I want to be able to open the file, chop each line and send individual messages to each address.. okay who is confused as Im not giving you much description here, well okay heres what the script looks like....

    #!/usr/bin/php -q

    <?

    $sms_list = "test_number"; $emails = file($sms_list);

    for ($i=0; $i < count($emails); $i++) $emails[$i] = trim($emails[$i]); $recipient = implode(",", $emails);

    print "$recipient";

    {

    $mail_subject="test this"; $mail_body="testing"; mail($recipient, $mail_subject, $mail_body); print "mail sent\n";

    }

    ?>

    Im just thinking(trying to at least) I need some sort of foreach statement like in perl, right? so that it would say

    foreach($recipient) { send mail }

    anyone that could maybe guide me?

    Thanks in advance

    C-Ya

    Chris Grigor ---------------------------------------------------------------------------- -------------- Client Services Call Center: 0860 100 154 Fax: +27 11 340 7345 E-Mail: SupportBus-Sol.co.za ---------------------------------------------------------------------------- -------------- M-WEB Business Solutions Making it happen.

    Go shopping http://shopping.mweb.co.za Get your business online http://business.mweb.com

    "We all know Linux is great...it does infinite loops in 5 seconds." - Linus Torvalds

    attached mail follows:


    I think this is what you want to do:

    <? $sms_list = "test_number"; // This is the file with one e-mail address per line? $emails = file($sms_list);

    foreach($emails as $this_is_one_address) { // Do what ever you want to. // $this_is_one_address contains one element from $emails };

    Niklas

    -----Original Message----- From: Chris Grigor [mailto:CGrigormweb.com] Sent: 9. tammikuuta 2002 8:59 To: 'Php-General-List (E-mail)' Subject: [PHP] foreach statement

    Okay lets see who has there thinking caps on today (cos I really dont)

    I have a list of email addresses stored in a text file.

    I am able to run the script and get all the mail addresses in the list mailed but thats all in one mail. I want to be able to open the file, chop each line and send individual messages to each address.. okay who is confused as Im not giving you much description here, well okay heres what the script looks like....

    #!/usr/bin/php -q

    <?

    $sms_list = "test_number"; $emails = file($sms_list);

    for ($i=0; $i < count($emails); $i++) $emails[$i] = trim($emails[$i]); $recipient = implode(",", $emails);

    print "$recipient";

    {

    $mail_subject="test this"; $mail_body="testing"; mail($recipient, $mail_subject, $mail_body); print "mail sent\n";

    }

    ?>

    Im just thinking(trying to at least) I need some sort of foreach statement like in perl, right? so that it would say

    foreach($recipient) { send mail }

    anyone that could maybe guide me?

    Thanks in advance

    C-Ya

    Chris Grigor ------------------------------------------------------------------------

    ----
    --------------
    Client Services
    Call Center: 0860 100 154
    Fax: +27 11 340 7345
    E-Mail: SupportBus-Sol.co.za
    ------------------------------------------------------------------------
    ----
    --------------
    M-WEB Business Solutions
    Making it happen.
    

    Go shopping http://shopping.mweb.co.za Get your business online http://business.mweb.com

    "We all know Linux is great...it does infinite loops in 5 seconds." - Linus Torvalds

    -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-helplists.php.net To contact the list administrators, e-mail: php-list-adminlists.php.net

    attached mail follows:


    Hey Niklas

    yea thats what I want, just one thing

    foreach($emails as $this_is_one_address) {

    would it be

    foreach($emails) {

    or am I missing something in there ?

    ?????

    <? $sms_list = "test_number"; // This is the file with one e-mail address per line? $emails = file($sms_list);

    foreach($emails as $this_is_one_address) { // Do what ever you want to. // $this_is_one_address contains one element from $emails };

    Niklas

    -----Original Message----- From: Chris Grigor [mailto:CGrigormweb.com] Sent: 9. tammikuuta 2002 8:59 To: 'Php-General-List (E-mail)' Subject: [PHP] foreach statement

    Okay lets see who has there thinking caps on today (cos I really dont)

    I have a list of email addresses stored in a text file.

    I am able to run the script and get all the mail addresses in the list mailed but thats all in one mail. I want to be able to open the file, chop each line and send individual messages to each address.. okay who is confused as Im not giving you much description here, well okay heres what the script looks like....

    #!/usr/bin/php -q

    <?

    $sms_list = "test_number"; $emails = file($sms_list);

    for ($i=0; $i < count($emails); $i++) $emails[$i] = trim($emails[$i]); $recipient = implode(",", $emails);

    print "$recipient";

    {

    $mail_subject="test this"; $mail_body="testing"; mail($recipient, $mail_subject, $mail_body); print "mail sent\n";

    }

    ?>

    Im just thinking(trying to at least) I need some sort of foreach statement like in perl, right? so that it would say

    foreach($recipient) { send mail }

    anyone that could maybe guide me?

    Thanks in advance

    C-Ya

    Chris Grigor ------------------------------------------------------------------------

    ----
    --------------
    Client Services
    Call Center: 0860 100 154
    Fax: +27 11 340 7345
    E-Mail: SupportBus-Sol.co.za
    ------------------------------------------------------------------------
    ----
    --------------
    M-WEB Business Solutions
    Making it happen.
    

    Go shopping http://shopping.mweb.co.za Get your business online http://business.mweb.com

    "We all know Linux is great...it does infinite loops in 5 seconds." - Linus Torvalds

    -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-helplists.php.net To contact the list administrators, e-mail: php-list-adminlists.php.net

    -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-helplists.php.net To contact the list administrators, e-mail: php-list-adminlists.php.net

    attached mail follows:


    Nope, the exact syntax is

    foreach ($emails as $this_is_one_address) {

    }

    ...With that "as" in there.

    HTH David Balatero david.balateroattbi.com

    ----- Original Message ----- From: "Chris Grigor" <CGrigormweb.com> To: <niklas.listspublico.fi>; "Php-General" <php-generallists.php.net> Sent: Tuesday, January 08, 2002 11.44 PM Subject: RE: [PHP] foreach statement

    > Hey Niklas > > yea thats what I want, just one thing > > foreach($emails as $this_is_one_address) { > > would it be > > foreach($emails) { > > or am I missing something in there ? > > ????? > > > > > > <? > $sms_list = "test_number"; // This is the file with one e-mail address > per line? > $emails = file($sms_list); > > foreach($emails as $this_is_one_address) { > // Do what ever you want to. > // $this_is_one_address contains one element from $emails > }; > > > Niklas > > > > -----Original Message----- > From: Chris Grigor [mailto:CGrigormweb.com] > Sent: 9. tammikuuta 2002 8:59 > To: 'Php-General-List (E-mail)' > Subject: [PHP] foreach statement > > > Okay lets see who has there thinking caps on today (cos I really dont) > > I have a list of email addresses stored in a text file. > > I am able to run the script and get all the mail addresses in the list > mailed but > thats all in one mail. I want to be able to open the file, chop each > line and send > individual messages to each address.. okay who is confused as Im not > giving you much > description here, well okay heres what the script looks like.... > > #!/usr/bin/php -q > > <? > > > $sms_list = "test_number"; > $emails = file($sms_list); > > for ($i=0; $i < count($emails); $i++) $emails[$i] = > trim($emails[$i]); > $recipient = implode(",", $emails); > > print "$recipient"; > > > { > > $mail_subject="test this"; > $mail_body="testing"; > mail($recipient, $mail_subject, $mail_body); > print "mail sent\n"; > > } > > > ?> > > > Im just thinking(trying to at least) I need some sort of foreach > statement like in perl, right? > so that it would say > > foreach($recipient) > { > send mail > } > > > anyone that could maybe guide me? > > Thanks in advance > > C-Ya > > Chris Grigor > ------------------------------------------------------------------------ > ---- > -------------- > Client Services > Call Center: 0860 100 154 > Fax: +27 11 340 7345 > E-Mail: SupportBus-Sol.co.za > ------------------------------------------------------------------------ > ---- > -------------- > M-WEB Business Solutions > Making it happen. > > Go shopping http://shopping.mweb.co.za > Get your business online http://business.mweb.com > > "We all know Linux is great...it does infinite loops in 5 seconds." > - Linus Torvalds > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net To > contact the list administrators, e-mail: php-list-adminlists.php.net > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net >

    attached mail follows:


    Foreach works in PHP just like I told.

    foreach($emails as $this_is_one_address) is the correct form where $emails is an array and $this_is_one_address gets one element from $emails.

    This is similar to this (technically):

    for ($i = 0; $i < count($emails); ++$i) { $this_is_one_address = $emails[$i]; // Do anything you want with $this_is_one_address };

    I suggest that you use the for-loop if $emails array is big. Takes less memory.

    Niklas

    -----Original Message----- From: Chris Grigor [mailto:CGrigormweb.com] Sent: 9. tammikuuta 2002 9:44 To: 'niklas.listspublico.fi'; Php-General Subject: RE: [PHP] foreach statement

    Hey Niklas

    yea thats what I want, just one thing

    foreach($emails as $this_is_one_address) {

    would it be

    foreach($emails) {

    or am I missing something in there ?

    ?????

    <? $sms_list = "test_number"; // This is the file with one e-mail address per line? $emails = file($sms_list);

    foreach($emails as $this_is_one_address) { // Do what ever you want to. // $this_is_one_address contains one element from $emails };

    Niklas

    -----Original Message----- From: Chris Grigor [mailto:CGrigormweb.com] Sent: 9. tammikuuta 2002 8:59 To: 'Php-General-List (E-mail)' Subject: [PHP] foreach statement

    Okay lets see who has there thinking caps on today (cos I really dont)

    I have a list of email addresses stored in a text file.

    I am able to run the script and get all the mail addresses in the list mailed but thats all in one mail. I want to be able to open the file, chop each line and send individual messages to each address.. okay who is confused as Im not giving you much description here, well okay heres what the script looks like....

    #!/usr/bin/php -q

    <?

    $sms_list = "test_number"; $emails = file($sms_list);

    for ($i=0; $i < count($emails); $i++) $emails[$i] = trim($emails[$i]); $recipient = implode(",", $emails);

    print "$recipient";

    {

    $mail_subject="test this"; $mail_body="testing"; mail($recipient, $mail_subject, $mail_body); print "mail sent\n";

    }

    ?>

    Im just thinking(trying to at least) I need some sort of foreach statement like in perl, right? so that it would say

    foreach($recipient) { send mail }

    anyone that could maybe guide me?

    Thanks in advance

    C-Ya

    Chris Grigor ------------------------------------------------------------------------

    ----
    --------------
    Client Services
    Call Center: 0860 100 154
    Fax: +27 11 340 7345
    E-Mail: SupportBus-Sol.co.za
    ------------------------------------------------------------------------
    ----
    --------------
    M-WEB Business Solutions
    Making it happen.
    

    Go shopping http://shopping.mweb.co.za Get your business online http://business.mweb.com

    "We all know Linux is great...it does infinite loops in 5 seconds." - Linus Torvalds

    -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-helplists.php.net To contact the list administrators, e-mail: php-list-adminlists.php.net

    -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-helplists.php.net To contact the list administrators, e-mail: php-list-adminlists.php.net

    -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-helplists.php.net To contact the list administrators, e-mail: php-list-adminlists.php.net

    attached mail follows:


    Thanks!! its working !!!

    ***BIG SMILE****

    Niklas you genious !!!!

    -----Original Message----- From: Niklas Lampén [mailto:niklas.listspublico.fi] Sent: Wednesday, January 09, 2002 10:15 AM To: Php-General Subject: RE: [PHP] foreach statement

    Foreach works in PHP just like I told.

    foreach($emails as $this_is_one_address) is the correct form where $emails is an array and $this_is_one_address gets one element from $emails.

    This is similar to this (technically):

    for ($i = 0; $i < count($emails); ++$i) { $this_is_one_address = $emails[$i]; // Do anything you want with $this_is_one_address };

    I suggest that you use the for-loop if $emails array is big. Takes less memory.

    Niklas

    -----Original Message----- From: Chris Grigor [mailto:CGrigormweb.com] Sent: 9. tammikuuta 2002 9:44 To: 'niklas.listspublico.fi'; Php-General Subject: RE: [PHP] foreach statement

    Hey Niklas

    yea thats what I want, just one thing

    foreach($emails as $this_is_one_address) {

    would it be

    foreach($emails) {

    or am I missing something in there ?

    ?????

    <? $sms_list = "test_number"; // This is the file with one e-mail address per line? $emails = file($sms_list);

    foreach($emails as $this_is_one_address) { // Do what ever you want to. // $this_is_one_address contains one element from $emails };

    Niklas

    -----Original Message----- From: Chris Grigor [mailto:CGrigormweb.com] Sent: 9. tammikuuta 2002 8:59 To: 'Php-General-List (E-mail)' Subject: [PHP] foreach statement

    Okay lets see who has there thinking caps on today (cos I really dont)

    I have a list of email addresses stored in a text file.

    I am able to run the script and get all the mail addresses in the list mailed but thats all in one mail. I want to be able to open the file, chop each line and send individual messages to each address.. okay who is confused as Im not giving you much description here, well okay heres what the script looks like....

    #!/usr/bin/php -q

    <?

    $sms_list = "test_number"; $emails = file($sms_list);

    for ($i=0; $i < count($emails); $i++) $emails[$i] = trim($emails[$i]); $recipient = implode(",", $emails);

    print "$recipient";

    {

    $mail_subject="test this"; $mail_body="testing"; mail($recipient, $mail_subject, $mail_body); print "mail sent\n";

    }

    ?>

    Im just thinking(trying to at least) I need some sort of foreach statement like in perl, right? so that it would say

    foreach($recipient) { send mail }

    anyone that could maybe guide me?

    Thanks in advance

    C-Ya

    Chris Grigor ------------------------------------------------------------------------

    ----
    --------------
    Client Services
    Call Center: 0860 100 154
    Fax: +27 11 340 7345
    E-Mail: SupportBus-Sol.co.za
    ------------------------------------------------------------------------
    ----
    --------------
    M-WEB Business Solutions
    Making it happen.
    

    Go shopping http://shopping.mweb.co.za Get your business online http://business.mweb.com

    "We all know Linux is great...it does infinite loops in 5 seconds." - Linus Torvalds

    -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-helplists.php.net To contact the list administrators, e-mail: php-list-adminlists.php.net

    -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-helplists.php.net To contact the list administrators, e-mail: php-list-adminlists.php.net

    -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-helplists.php.net To contact the list administrators, e-mail: php-list-adminlists.php.net

    -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-helplists.php.net To contact the list administrators, e-mail: php-list-adminlists.php.net

    attached mail follows:


    You're welcome. :)

    Niklas

    P.S. I know... ;)

    -----Original Message----- From: Chris Grigor [mailto:CGrigormweb.com] Sent: 9. tammikuuta 2002 10:23 To: 'niklas.listspublico.fi'; Php-General Subject: RE: [PHP] foreach statement

    Thanks!! its working !!!

    ***BIG SMILE****

    Niklas you genious !!!!

    -----Original Message----- From: Niklas Lampén [mailto:niklas.listspublico.fi] Sent: Wednesday, January 09, 2002 10:15 AM To: Php-General Subject: RE: [PHP] foreach statement

    Foreach works in PHP just like I told.

    foreach($emails as $this_is_one_address) is the correct form where $emails is an array and $this_is_one_address gets one element from $emails.

    This is similar to this (technically):

    for ($i = 0; $i < count($emails); ++$i) { $this_is_one_address = $emails[$i]; // Do anything you want with $this_is_one_address };

    I suggest that you use the for-loop if $emails array is big. Takes less memory.

    Niklas

    -----Original Message----- From: Chris Grigor [mailto:CGrigormweb.com] Sent: 9. tammikuuta 2002 9:44 To: 'niklas.listspublico.fi'; Php-General Subject: RE: [PHP] foreach statement

    Hey Niklas

    yea thats what I want, just one thing

    foreach($emails as $this_is_one_address) {

    would it be

    foreach($emails) {

    or am I missing something in there ?

    ?????

    <? $sms_list = "test_number"; // This is the file with one e-mail address per line? $emails = file($sms_list);

    foreach($emails as $this_is_one_address) { // Do what ever you want to. // $this_is_one_address contains one element from $emails };

    Niklas

    -----Original Message----- From: Chris Grigor [mailto:CGrigormweb.com] Sent: 9. tammikuuta 2002 8:59 To: 'Php-General-List (E-mail)' Subject: [PHP] foreach statement

    Okay lets see who has there thinking caps on today (cos I really dont)

    I have a list of email addresses stored in a text file.

    I am able to run the script and get all the mail addresses in the list mailed but thats all in one mail. I want to be able to open the file, chop each line and send individual messages to each address.. okay who is confused as Im not giving you much description here, well okay heres what the script looks like....

    #!/usr/bin/php -q

    <?

    $sms_list = "test_number"; $emails = file($sms_list);

    for ($i=0; $i < count($emails); $i++) $emails[$i] = trim($emails[$i]); $recipient = implode(",", $emails);

    print "$recipient";

    {

    $mail_subject="test this"; $mail_body="testing"; mail($recipient, $mail_subject, $mail_body); print "mail sent\n";

    }

    ?>

    Im just thinking(trying to at least) I need some sort of foreach statement like in perl, right? so that it would say

    foreach($recipient) { send mail }

    anyone that could maybe guide me?

    Thanks in advance

    C-Ya

    Chris Grigor ------------------------------------------------------------------------

    ----
    --------------
    Client Services
    Call Center: 0860 100 154
    Fax: +27 11 340 7345
    E-Mail: SupportBus-Sol.co.za
    ------------------------------------------------------------------------
    ----
    --------------
    M-WEB Business Solutions
    Making it happen.
    

    Go shopping http://shopping.mweb.co.za Get your business online http://business.mweb.com

    "We all know Linux is great...it does infinite loops in 5 seconds." - Linus Torvalds

    -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-helplists.php.net To contact the list administrators, e-mail: php-list-adminlists.php.net

    -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-helplists.php.net To contact the list administrators, e-mail: php-list-adminlists.php.net

    -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-helplists.php.net To contact the list administrators, e-mail: php-list-adminlists.php.net

    -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-helplists.php.net To contact the list administrators, e-mail: php-list-adminlists.php.net

    -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-helplists.php.net To contact the list administrators, e-mail: php-list-adminlists.php.net

    attached mail follows:


    For those of you who use the cURL extension, the underlying library is putting up a little questionaire, to help get a better idea of what the cURL user community wants, feel free to go ahead and participate, the URL (without reading the attachment :) is:

    http://curl.haxx.se/q/

    -Sterling

    attached mail follows:


    Hello fellow curl users!

    I'd like to ask you all who read this to skip over to the curl web site and fill in the questionnaire regarding various aspects of curl.

    I want to know what we all think of curl, what the general people think is important, what's bad, what's good and where to put the most focus in the immediate future development.

    There are ten quickly answered questions that'll only take you a few minutes to fill in.

    Give me your view of things on this URL:

    http://curl.haxx.se/q/

    I appreciate if you fill in your opinion only once for each individual.

    -- 
        Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
    

    attached mail follows:


    Hi Everyone,

    I did ask this earlier, but I have made some head way since, but I'm still not sure that I have things right.

    What datatype should I use for zip files?

    How do I create a link to a file to be downloaded from the database?

    All the examples I have read all relate to images, which hasn't really helped.

    THanks,

    Pete

    attached mail follows:


    Hy Peter,

    Peter Lavender wrote:

    > Hi Everyone, > > I did ask this earlier, but I have made some head way since, but I'm still > not sure that I have things right. > > What datatype should I use for zip files?

    You should use the blob type therefore

    > > How do I create a link to a file to be downloaded from the database?

    first you need a php script that pulls the data out of the database and echoes an appropriate header, and after this all the binary data of your file, you would then link it and give the id or whatever you use to identify it in the database as parameter to this script.

    > > All the examples I have read all relate to images, which hasn't really > helped.

    it's exactly the same with zips as with images, the only difference is the header for the mime type which is "image/gif" for gif's and "application/zip" for zips If you already know everything for images out oif a Mysql, then i don't tell it again here - ask if you still have problems!

    henning

    attached mail follows:


    are you shure about putting binarydata into a database?

    cant you do it with links? performance would be better this way i think.

    "Henning Sprang" <henning_spranggmx.de> schrieb im Newsbeitrag news:3C3C2B03.7040408gmx.de... > Hy Peter, > > Peter Lavender wrote: > > > Hi Everyone, > > > > I did ask this earlier, but I have made some head way since, but I'm still > > not sure that I have things right. > > > > What datatype should I use for zip files? > > > You should use the blob type therefore > > > > > > How do I create a link to a file to be downloaded from the database? > > > first you need a php script that pulls the data out of the database and > echoes an appropriate header, and after this all the binary data of your > file, you would then link it and give the id or whatever you use to > identify it in the database as parameter to this script. > > > > > > All the examples I have read all relate to images, which hasn't really > > helped. > > > it's exactly the same with zips as with images, the only difference is > the header for the mime type which is "image/gif" for gif's and > "application/zip" for zips > If you already know everything for images out oif a Mysql, then i don't > tell it again here - ask if you still have problems! > > henning > > > > >

    attached mail follows:


    >No such table, the best you can do is look at their hostname and parse the last part ie .co.uk or .com... And >then u can try and figure where they are from that

    Err... Wrong.....

    You could host a .co.uk in the US or any other country for that matter! What you need to do is find the IP do a RIPE lookup at www.ripe.net and that will tell you who the IP is assigned to and where in the world they are. Of course if its a ISP in Maryland, USA they could have a dialup user from Australia connected so it only gives limited information.

    Regards

    Jon

    --
    Jon Farmer
    Systems Programmer, Entanet www.enta.net
    Tel 01952 428969 Mob 07763 620378
    PGP Key available, send email with subject: Send PGP Key
    

    attached mail follows:


    I 'm not sure, but i beleive you can get visitor's country from Apache 's Varialble $HTTP_ACCEPT_LANGUAGE. For further information read "Predefined Variables" in the manual.

    Hope it works!!!

    attached mail follows:


    On Wed, Jan 09, 2002 at 11:33:46AM +0200, Dimitris Kossikidis wrote: : : I 'm not sure, but i beleive you can get visitor's country from Apache 's : Varialble $HTTP_ACCEPT_LANGUAGE. For further information read "Predefined : Variables" in the manual.

    This works assuming the browser itself sends the "correct" country code. Browsers in most places will send a "Content-language: en" regardless of what country the user's browser is running within.

    -- 
    Eugene Lee
    eugenefsck.net
    

    attached mail follows:


    First of all sorry if you have already read this on one of the other PHP Mailing Lists, the reason I am posting it in a couple of different ones is because I really do believe that many people can make use of this extenstion and I know there are people out there who need this extension because I have read post about people who are having problem hiding SQL passwords in scripts etc.

    Anyway here's the message:

    Hi, Maybe one or two of you may have read a post a while back about a PHP security extention called Scripthash. For those of you who can't remember or don't know this extension it lets you solve the age old problem of hardcoding passwords in your PHP scripts and also makes it possible to execute scripts from PHP as a different user (or even root) safely! This extension can ONLY be used when you are using PHP as an Apache module on a Unix/Linux platform.

    The original version was hard to install as you would have to compile it into PHP. It also had some major bugs, the new version 0.5 has all previously known bugs fixed and some new features. Scripthash 0.5 is for PHP 4.1.x (only tested with 4.1.1) but users of PHP 4.0.x can download Scripthash 0.4 which is exactly the same but made to run with 4.0.x.

    The new version is very easy to install, all you need to do is either download the tarball or the RedHat Source RPM and build then install. Then add the following lines to you php.ini

    extension_dir=/usr/lib/php/extensions extension=scripthash.so

    then restart Apache. To confirm everything it is working make a script with a call to the phpinfo() function and there should now be a section called Scripthash. To use the extenstion see README.html

    To use some extended functionality you have to patch the PHP source code then rebuild it. This patch will give you two new PHP globals called $VIRTUAL_UID and $VIRTUAL_GID which contains the user id and the group id of the virtual server being hit, you don't have to do this but you will get more control with scripthash.

    Finally I'll tell you what I hope to get from posting this message, I would just like to see some interest, bug reports, suggestions, comments and maybe some well written scripthash daemons (see README.html) :). I think this is an extremely useful piece of code and it is now stable and easy to use.

    You can get/find out more about Scripthash at http://www.scl.co.uk/scripthash/ Sadly we have not had the time to update the documentation for this module but it is on our TODO list and in the mean time we are happy to reply to and emails you send us.

    Thanks for your time Tom

    -- 
    

    *************************************************** List Client SCL Internet Services URL http://www.scl.co.uk/ Tel. +44 (0) 1239 711 888 ***************************************************

    attached mail follows:


    hea

    http://www.phparchiv.de/cgi-bin/links/jump.cgi?ID=182 and http://www.phparchiv.de/cgi-bin/links/jump.cgi?ID=2015

    gurix

    "Muhammad Asif" <mdasifwol.net.pk> schrieb im Newsbeitrag news:5.1.0.14.2.20020107185559.00a18400192.168.0.2... > > hi, > > Do PHP has some built-in support for Credit Card Processing? > > Is there any library available that can be used for processing Credit Cards? > > Thanks for your time. >

    attached mail follows:


    hea

    1. take a given javascriptmenu

    2. develop a database with th menu items

    3. make the Javascript dynamical with the php variables.

    It isn't anything to learn develop in php, just take it step for step.

    gurix

    "Kevin P" <webmasterodellwebdesign.com> schrieb im Newsbeitrag news:20020107150502.60250.qmailpb1.pair.com... > Hello > > I am extremely new to PHP and I want to have a clickable item that will > bring up a particular item from the database (i.e a menu) What is the > proceedure here? Can anyone help me? > > Thanks > > Kevin > >

    attached mail follows:


    // here's a nice example for a bcc adress, just generate a header

    $headers .= "From: Birthday Reminder <birthdayexample.com>\r\n";

    $headers .= "Cc: birthdayarchiveexample.com\r\n"; $headers .= "Bcc: birthdaycheckexample.com\r\n";

    /* and now mail it */ mail($to, $subject, $message, $headers);

    gurix

    "Tim Ward" <Tim.wardstivesdirect.com> schrieb im Newsbeitrag news:01D892A483EAD511926A00500416D3C004767AHUNTERS-MAIL... > If you mean blind carbon copy on e-mails then > www.php.net/manual/en/function.mail.php > <http://www.php.net/manual/en/function.mail.php> explains how to do it. If > you mean anything else please elaborate > > Tim > www.chessish.com <http://www.chessish.com> > > ---------- > From: Deependra B. Tandukar [SMTP:deepndraicimod.org.np] > Sent: 07 January 2002 03:29 > To: PHP General > Subject: bcc > > Greetings ! > > Is Bcc supported in PHP? > > Looking forward to hearing from you. > > Warm Regards, > DT >

    attached mail follows:


    ...

    attached mail follows:


    Hi, I was wondering how you could unshift a key value pair onto an array. In the manual one suggested using a function like this: function array_unshift_assoc(&$arr, $key, $val) { $arr = array_reverse($arr, true); $arr[$key] = $val; $arr = array_reverse($arr, true); return count($arr); } it is a nice trick but this did not really convince me. When you have eg an array like this: $a = array("foo"=>"bar", "foo2"=>"bar2") and you do an array_shift operation, you end up with ("foo2"=>"bar2"). So it is really easy to *remove* a key-value pair, but how do you put one in ? Marc

    attached mail follows:


    Try array_merge()

    Regards, Andrey Hristov ----- Original Message ----- From: "Marc Logghe" <marc.nospam.logghedevgen.com> To: <php-generallists.php.net> Sent: Wednesday, January 09, 2002 10:55 AM Subject: [PHP] unshift a key value pair

    > Hi, > I was wondering how you could unshift a key value pair onto an array. > In the manual one suggested using a function like this: > function array_unshift_assoc(&$arr, $key, $val) > { > $arr = array_reverse($arr, true); > $arr[$key] = $val; > $arr = array_reverse($arr, true); > return count($arr); > } > it is a nice trick but this did not really convince me. > When you have eg an array like this: $a = array("foo"=>"bar", > "foo2"=>"bar2") and you do an array_shift operation, > you end up with ("foo2"=>"bar2"). So it is really easy to *remove* a > key-value > pair, but how do you put one in ? > Marc > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net > >

    attached mail follows:


    That's exactly what I did to make it work I gave up playing with array_unshift. Thanks anyway. Marc "Andrey Hristov" <ahristovicygen.com> wrote in message news:087501c198ff$45961270$0b01a8c0ANDreY... > Try array_merge() > > > Regards, > Andrey Hristov > ----- Original Message ----- > From: "Marc Logghe" <marc.nospam.logghedevgen.com> > To: <php-generallists.php.net> > Sent: Wednesday, January 09, 2002 10:55 AM > Subject: [PHP] unshift a key value pair > > > > Hi, > > I was wondering how you could unshift a key value pair onto an array. > > In the manual one suggested using a function like this: > > function array_unshift_assoc(&$arr, $key, $val) > > { > > $arr = array_reverse($arr, true); > > $arr[$key] = $val; > > $arr = array_reverse($arr, true); > > return count($arr); > > } > > it is a nice trick but this did not really convince me. > > When you have eg an array like this: $a = array("foo"=>"bar", > > "foo2"=>"bar2") and you do an array_shift operation, > > you end up with ("foo2"=>"bar2"). So it is really easy to *remove* a > > key-value > > pair, but how do you put one in ? > > Marc > > > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > > For additional commands, e-mail: php-general-helplists.php.net > > To contact the list administrators, e-mail: php-list-adminlists.php.net > > > > >

    attached mail follows:


    In article <20020109085734.5575.qmailpb1.pair.com>, marc.nospam.logghedevgen.com (Marc Logghe) wrote:

    > So it is really easy to *remove* a key-value pair, but how do you put one in ?

    $arr[$key]=$val;

    -- 
    CC
    

    attached mail follows:


    Yes, of course, but the thing is that the order was important. I wanted to put in a new value/pair at the *start* of my array, so I thougth using array_unshift(), but that did not work or at leas I did not find how. With the $arr[$key]=$val assignment you add at the *end* of your array $arr. Thanks for your fast response Marc

    "Cc Zona" <emailcczona.com> wrote in message news:email-1BE178.03542109012002pb1.pair.com... > In article <20020109085734.5575.qmailpb1.pair.com>, > marc.nospam.logghedevgen.com (Marc Logghe) wrote: > > > So it is really easy to *remove* a key-value pair, but how do you put one in ? > > $arr[$key]=$val; > > -- > CC

    attached mail follows:


    Hi, I'm trying to let Webmin execute a script where I can use php as scripting language... (It will be good to work with a language as php in a remote administration server, as root!)

    Now the STRANGE problem:

    When I execute a test.cgi program from Webmin, it's executed as root, as it was from command line... that's good. The problem is that Webmin execute well _every_ program I tried , EXCEPT php !

    It seems that php needs some env variables to work well, and these variables aren't provided from the Webmin program, so to solve the problem I've to first understand WHY php does not work...

    Here are some tests:

    1) Executing a php that produce some output, or create a file works only when called from a login shell, not in Webmin 2) Executing a script that invoke "at" with the previous script doesn't work as well... from atq the scheduled processes are the same, but the one invoked from a login shell works, the invoked from Webmin not at all...

    ... what to do ?!?

    thanx very much, prakash

    attached mail follows:


    I have a website where I use sessions. After a user has logged of, the logon screen appears again. The username field is filled with the value from a cookie.

    What happens:

    For example: username = "Peter"

    In the situation that I log of (and the logon page appears), the username field gets the value from the cookie and the string "; PHPSESSID". ("Peter; PHPSESSID")

    When I close the browser window and open a new browser window the value of the username is correct ("Peter"). The string "; PHPSESSID" is not in the cookie. What is the reason that this string (the variable name for session id as set in my php.ini) appears in this field?

    In other words, why is the session_id variable name displayed in a field that is filled by a cookie. I also tried to end the session, but the only thing I can find is destroy_session and that only destroys everything that is within that session, but it does not kill the session itsselfs

    How do I solve this problem.

    Regards,

    Gilbert

    attached mail follows:


    Hi,

    Has anybody encountered the following error:

    "Fatal error: input in flex scanner failed in /***path***/info on line 1"

    The code that is most likely causing this is:

    <?php $my_cat_cust1="index.htm"; ?> <!-- Some HTML HERE --> <?php if(file_exists("/***path***/info/$my_cat_cust1")) include("/***path***/info/$my_cat_cust1"); ?>

    I'm running 4.0.6 on a Redhat 6.2

    I'm completely stumped, this looks like a completely innocent code. Any help or hits would be really appreciated!!

    Sincerely,

    Pavel Kharitonov Project Manager Intechnic Corporation http://www.intechnic.com Phone: (847) 816-1231

    attached mail follows:


    There's no need to 'pass' any variables.

    HINT: pretend the include() command is being replaced with the code in your include file, this means that whatever variables are set/available at that point will also be available in the include.

    On Mon, 28 Jan 2002 18:54:02 -0800, Evansville Scene wrote:

    >I'm having problems passing variables into included PHP files. How can I do this? >

    attached mail follows:


    Hi all,

    I've got a regex that's working fine, apart from one little problem.

    $tags = array ("script", "<!--<!\[CDATA\[", "\]\]>-->"); foreach ($tags as $currentTag) if (preg_match ("/^<\/". $currentTag. "/", $content)) // do something

    (checking to see if anything in the $tags array is at the start of the string)

    The problem is that it's not picking up "<!--<![CDATA[" and "]]>-->". I've escaped the [ and ] as I know they're reserved in regexes, but it seems there's something else that needs escaping or otherwise tweaking, and all manner of experimentation has proved fruitless :-(

    Can anyone help me out?

    Cheers Jon

    Witan Jardine 13 Southampton Place London WC1A 2AL Tel: 020 7404 4004

    Please visit us on the Internet: http://www.witanjardine.co.uk/

    The information included in this e-mail is of a confidential nature and is intended only for the addressee. If you are not the intended addressee, any disclosure, copying or distribution by you is prohibited and may be unlawful. Disclosure to any party other than the addressee, whether inadvertent or otherwise is not intended to waive privilege of confidentiality.

    attached mail follows:


    > Hi all, > > I've got a regex that's working fine, apart from one little problem. > > $tags = array ("script", > "<!--<!\[CDATA\[", > "\]\]>-->");

    A quick shot (perhaps I miss the point ;): if you do $x = "\["; then $x will contain "[". If you then do a regex with preg_match("/$x/", ..." eg. then it get's evaluated as preg_match("/[/", ... If you want the [ to be escaped in the regex you have to "double-escape" it: $x = "\ \["; (sorry, the two \ should be together without a space but my stupid mail-app converts the string thinking it's an network address) so $x will contain "\[" as you want ( the first backslash escapes the second).

    > foreach ($tags as $currentTag) > if (preg_match ("/^<\/". $currentTag. "/", $content)) > // do something > > > Witan Jardine > 13 Southampton Place > London WC1A 2AL > Tel: 020 7404 4004

    I hope I didn't miss the point and could help you best regards Stefan Rusterholz

    attached mail follows:


    > If you want the [ to be escaped in the regex you have to "double-escape" it: > $x = "\ \["; (sorry, the two \ should be together without a space but my > stupid mail-app converts the string thinking it's an network address) > so $x will contain "\[" as you want ( the first backslash escapes the > second).

    Hi Stefan,

    Thanks very much for that, it does make sense :-)

    Unfortunately it still hasn't fixed the problem... I suppose my question has now boiled down to "do I need to escape !, <, or - in a regex?" :-)

    Cheers Jon

    attached mail follows:


    > > If you want the [ to be escaped in the regex you have to "double-escape" > it: > > $x = "\ \["; (sorry, the two \ should be together without a space but my > > stupid mail-app converts the string thinking it's an network address) > > so $x will contain "\[" as you want ( the first backslash escapes the > > second). > > Hi Stefan, > > Thanks very much for that, it does make sense :-) > > Unfortunately it still hasn't fixed the problem... I suppose my question has > now boiled down to "do I need to escape !, <, or - in a regex?" :-) > > Cheers > Jon

    here the expression again: >>>$tags = array ("script", >>> "<!--<!\[CDATA\[", >>> "\]\]>-->"); >>>foreach ($tags as $currentTag) >>> if (preg_match ("/^<\/". $currentTag. "/", $content)) >>> // do something

    As far as I can see (notice: I'm not a regex-king ;) the regex seems correct to me. The only thing I'm wondering about is the "/^<" (second last line of the citation). Together with your expression in the array it results in preg_match("/<\/<!\[CDATA\[/", ...) I'm wondering if that (</<![CDATA...) is really what you want to match (and not only <![CDATA without the trailing </).

    If it's not that then I suggest you to do simple example scripts where you have none-dynamic regex's to test if the expression works (that's the way I do that stuff - no really because I ever think I'd THIS TIME be able to do it without, but I haven't thought right till today ;)

    lot of luck mastering your expressions stefan rusterholz

    attached mail follows:


    > As far as I can see (notice: I'm not a regex-king ;) the regex seems correct > to me. The only thing I'm wondering about is the "/^<" (second last line of > the citation). Together with your expression in the array it results in > preg_match("/<\/<!\[CDATA\[/", ...) > I'm wondering if that (</<![CDATA...) is really what you want to match (and > not only <![CDATA without the trailing </).

    Aaarrrrrrrrrrgh <thump> <thump> <thump> <thump> <thump>

    That's it! Thanks very much Stefan.

    It's trying to match a closing HTML tag, but of course that doesn't apply to CDATA, so it all went pear-shaped. I stared at that bloody regex for hours, as well <sigh>

    Cheers Jon

    attached mail follows:


    I have got a page that i am loading sessions on with the following code:

    session_start(); $HTTP_SESSION_VARS['sess_id']=$PHPSESSID;

    Except that it will not assign an actual value until i hit refresh on my browser. Any ideas for a fix?

    Thanks in advance,

    Ryan Kelley

    attached mail follows:


    when session_start() is called for a first time, it generates session_id and set a cookie for the browser. The common name for the cookie is PHPSESSID. You receive it on the refresh, because after the first load this cookie is known by the browser. When you hit the page for a first time, there is no set PHPSESSID cookie, so PHP WILL NOT have $GLOBALS['PHPSESSID'] variable (assuming register_globals is on in php.ini). If you want the id. Get it from session_id().

    HTH

    Regards, Andrey Hristov ----- Original Message ----- From: "Ryan Kelley" <kelleyrinternetinvisions.com> To: <php-generallists.php.net> Sent: Wednesday, January 09, 2002 4:02 PM Subject: [PHP] Sessions don't load

    > I have got a page that i am loading sessions on with the following code: > > session_start(); > $HTTP_SESSION_VARS['sess_id']=$PHPSESSID; > > Except that it will not assign an actual value until i hit refresh on my > browser. Any ideas for a fix? > > Thanks in advance, > > Ryan Kelley > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net > >

    attached mail follows:


    Hello there, I need some help.

    I have to do a technical report(about 2200 words) comparing PHP to ASP. I have already decided to make PHP the winner becasue it is superior. But I am kinda stumped on what areas to compare the two.

    If you could help me out in suggesting some possible areas of comparison. Keeping in mind that I need about the same amount of info on both PHP and ASP. Also if you could point me in the right direction by including some web links that deal with the topic.

    Thank You, Jake

    attached mail follows:


    Database is a good point. PHP has native support for several, while I believe ASP do not (through ODBC).

    Modules, and their price. At least I heard in ASP you have to pay for some of them (well, more than those on PHP).

    Typecast? I am not sure if in ASP you have to, I remember I heard somewhere. Like "int var = 10"

    Overall, how fast developers fix bugs is also a good thing... I remeber I have seen bugs corrected on PHP only after 15 being reported..

    I have never programmed on ASP, these are just stuff I heard in some places... So sorry for the lack of objectiveness (spelling on that? :-)).

    --
    

    Julio Nobrega.

    Um dia eu chego lá: http://sourceforge.net/projects/toca

    attached mail follows:


    Well, I personally prefer PHP over ASP because better support from webhosting companies, but ASP has some good points. This is especially the case if you can setup the complete hosting environment yourself and have some money to spend.

    First of all databases. PHP has support for a limited but interesting list of databases, especially the support for mysql and postgres is handy for a webserver. On the other hand, ASP has good support for most bussiness servers (ORACLE MS SQL Server,....) with OLE-DB and a lot more databases with ODBC.

    The development tools. Definately a win for ASP (with vb.net C# and C++ you have a complete IDE and with Dreamweaver Ultradev you can pretty much point and click. SO you can choose whatever tool you like. PHP has very limited IDE's.

    Price. ASP solutions are mostly build with Windows 2000 Server and MS SQL Server or Oracle and an expensive IDE. So it's pretty expensive to build. PHP is mostly used with Linux, Apache and MySQL and is a lot cheaper (you only need to buy the hardware and the software is virtually free)

    Programming language: This is off course a personal taste but with ASP (.net) you can use VB/C++/C#. So if you are used to VB or C++ it's a bit easier to start with.

    Modules. Both have a lot of free tools available. However I personally find the PHP modules more usefull. (With the exception of the Crystal Report generator in .net, pretty usable reports without a lot of work).

    It's a bit easier for a novice to get started with ASP as with PHP, and it's pertty easy to make the project look good.

    So, if you have the cash and some inexperienced programmers working for you ASP is the save bet. If you have a small company, are a student, depend on webhosting or are a pretty experienced programmer, PHP might be a better choose.

    Robert Klinkenberg

    attached mail follows:


    I am a newbie to programming, ASP is easier to learn? I heard PHP was

    At 04:48 PM 1/9/2002 +0100, Robert Klinkenberg wrote: >Well, I personally prefer PHP over ASP because better support from >webhosting companies, but ASP has some good points. >This is especially the case if you can setup the complete hosting >environment yourself and have some money to spend. > >First of all databases. PHP has support for a limited but interesting list >of databases, especially the support for mysql and postgres is handy for a >webserver. On the other hand, ASP has good support for most bussiness >servers (ORACLE MS SQL Server,....) with OLE-DB and a lot more databases >with ODBC. > >The development tools. Definately a win for ASP (with vb.net C# and C++ you >have a complete IDE and with Dreamweaver Ultradev you can pretty much point >and click. SO you can choose whatever tool you like. >PHP has very limited IDE's. > >Price. ASP solutions are mostly build with Windows 2000 Server and MS SQL >Server or Oracle and an expensive IDE. So it's pretty expensive to build. >PHP is mostly used with Linux, Apache and MySQL and is a lot cheaper (you >only need to buy the hardware and the software is virtually free) > >Programming language: This is off course a personal taste but with ASP >(.net) you can use VB/C++/C#. So if you are used to VB or C++ it's a bit >easier to start with. > >Modules. Both have a lot of free tools available. However I personally find >the PHP modules more usefull. (With the exception of the Crystal Report >generator in .net, pretty usable reports without a lot of work). > >It's a bit easier for a novice to get started with ASP as with PHP, and it's >pertty easy to make the project look good. > >So, if you have the cash and some inexperienced programmers working for you >ASP is the save bet. If you have a small company, are a student, depend on >webhosting or are a pretty experienced programmer, PHP might be a better >choose. > >Robert Klinkenberg > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: php-general-unsubscribelists.php.net >For additional commands, e-mail: php-general-helplists.php.net >To contact the list administrators, e-mail: php-list-adminlists.php.net

    attached mail follows:


    Jake wrote:

    > Hello there, I need some help. > > I have to do a technical report(about 2200 words) comparing PHP to ASP. I > have already decided to make PHP the winner becasue it is superior. But I > am kinda stumped on what areas to compare the two. > > If you could help me out in suggesting some possible areas of comparison. > Keeping in mind that I need about the same amount of info on both PHP and > ASP. Also if you could point me in the right direction by including some > web links that deal with the topic. >

    So, you've decided to make something the 'winner' before doing the research? I hope this isn't for a real class of any sort (something where you're getting a grade or a salary review).

    I'm working on a paper with an ASP expert, but it probably won't be ready in time for your needs.

    Databases - although PHP 'supports' many databases natively, the support is in the form of 3rd party libraries with PHP wrapper functions. Nothing inherently wrong with that, but the current method dictates that to use oracle you use oci_ functions, for mysql you use mysql_ functions, etc., giving rise to the 'database portability' issue. Yes, there are db abstraction classes available in PHP, but nothing is native to the language, and that extra layer slows things down (just like ODBC can slow things down in the Windows world). Don't go throwing 'native db' support around too much without backing it up with solid argument.

    If you want to make PHP the 'winner', go for price/performance. In many benchmarks you'll see one or the other winning - there's no clear cut winner by a huge margin in most situations. The 'winning' aspects are price and platform independance. Generally, my PHP code will work under Windows, Solaris, Linux, HPUX, and other platforms with pretty much identical behaviour. Not so with ASP/VBScript.

    Even if Windows/ASP/VBScript on machine X is 20% faster than Linux/Apache/PHP on the same machine, chances are it's probably 100% more expensive.

    Memory management - with Zend or APC or other cache products, PHP scripts are cached individually, so if 20 pages include() "header.php" header.php is only cached once in memory (this seems to be my view of how it works, having played with various caching systems under PHP). In the ASP world, if I have 20 asp pages which include header.asp, header.asp is effectively kept in memory 20 times, because the entire asp page (with all its includes) is cached as one file. That may be slightly faster from a processing standpoint (don't know for certain) but it's not good memory management, from what I can tell. Yes, RAM is cheap, but scripts are also getting more larger and more complex as well. Also, many people hosting on third party systems can't simply call the provider and demand an extra 512 megs be installed to get better performance.

    Procedural - you STILL can't actually 'include' a file in ASP/VBScript. The 'include' is an SSI directive, which is processed before the ASP engine starts. In ASP3 there is a new 'server.execute', but in the called script, you can't reference functions or variables from the calling script, so it's not as easy or intuitive as the PHP include() behaviour (imo anyway).

    Hope that helps...

    Michael Kimsal michaeltapinternet.com http://www.tapinternet.com/php PHP Training Courses 734-480-9961 Toll Free - 1-866-745-3660

    attached mail follows:


    Jake wrote:

    > Hello there, I need some help. > > I have to do a technical report(about 2200 words) comparing PHP to ASP. I > have already decided to make PHP the winner becasue it is superior. But I > am kinda stumped on what areas to compare the two. > > If you could help me out in suggesting some possible areas of comparison. > Keeping in mind that I need about the same amount of info on both PHP and > ASP. Also if you could point me in the right direction by including some > web links that deal with the topic. >

    So, you've decided to make something the 'winner' before doing the research? I hope this isn't for a real class of any sort (something where you're getting a grade or a salary review).

    I'm working on a paper with an ASP expert, but it probably won't be ready in time for your needs.

    Databases - although PHP 'supports' many databases natively, the support is in the form of 3rd party libraries with PHP wrapper functions. Nothing inherently wrong with that, but the current method dictates that to use oracle you use oci_ functions, for mysql you use mysql_ functions, etc., giving rise to the 'database portability' issue. Yes, there are db abstraction classes available in PHP, but nothing is native to the language, and that extra layer slows things down (just like ODBC can slow things down in the Windows world). Don't go throwing 'native db' support around too much without backing it up with solid argument.

    If you want to make PHP the 'winner', go for price/performance. In many benchmarks you'll see one or the other winning - there's no clear cut winner by a huge margin in most situations. The 'winning' aspects are price and platform independance. Generally, my PHP code will work under Windows, Solaris, Linux, HPUX, and other platforms with pretty much identical behaviour. Not so with ASP/VBScript.

    Even if Windows/ASP/VBScript on machine X is 20% faster than Linux/Apache/PHP on the same machine, chances are it's probably 100% more expensive.

    Memory management - with Zend or APC or other cache products, PHP scripts are cached individually, so if 20 pages include() "header.php" header.php is only cached once in memory (this seems to be my view of how it works, having played with various caching systems under PHP). In the ASP world, if I have 20 asp pages which include header.asp, header.asp is effectively kept in memory 20 times, because the entire asp page (with all its includes) is cached as one file. That may be slightly faster from a processing standpoint (don't know for certain) but it's not good memory management, from what I can tell. Yes, RAM is cheap, but scripts are also getting more larger and more complex as well. Also, many people hosting on third party systems can't simply call the provider and demand an extra 512 megs be installed to get better performance.

    Procedural - you STILL can't actually 'include' a file in ASP/VBScript. The 'include' is an SSI directive, which is processed before the ASP engine starts. In ASP3 there is a new 'server.execute', but in the called script, you can't reference functions or variables from the calling script, so it's not as easy or intuitive as the PHP include() behaviour (imo anyway).

    Hope that helps...

    Michael Kimsal michaeltapinternet.com http://www.tapinternet.com/php PHP Training Courses 734-480-9961 Toll Free - 1-866-745-3660

    attached mail follows:


    Well, I don't know ASP, but I fonud that learning PHP was really easy when you already know C, C++ .... And no variables types, pointer, etc ... is great !!!

    Le Mercredi 9 Janvier 2002 17:01, Dean Ouellette a écrit : > I am a newbie to programming, ASP is easier to learn? I heard PHP was > > At 04:48 PM 1/9/2002 +0100, Robert Klinkenberg wrote: > >Well, I personally prefer PHP over ASP because better support from > >webhosting companies, but ASP has some good points. > >This is especially the case if you can setup the complete hosting > >environment yourself and have some money to spend. > > > >First of all databases. PHP has support for a limited but interesting list > >of databases, especially the support for mysql and postgres is handy for a > >webserver. On the other hand, ASP has good support for most bussiness > >servers (ORACLE MS SQL Server,....) with OLE-DB and a lot more databases > >with ODBC. > > > >The development tools. Definately a win for ASP (with vb.net C# and C++ > > you have a complete IDE and with Dreamweaver Ultradev you can pretty much > > point and click. SO you can choose whatever tool you like. > >PHP has very limited IDE's. > > > >Price. ASP solutions are mostly build with Windows 2000 Server and MS SQL > >Server or Oracle and an expensive IDE. So it's pretty expensive to build. > >PHP is mostly used with Linux, Apache and MySQL and is a lot cheaper (you > >only need to buy the hardware and the software is virtually free) > > > >Programming language: This is off course a personal taste but with ASP > >(.net) you can use VB/C++/C#. So if you are used to VB or C++ it's a bit > >easier to start with. > > > >Modules. Both have a lot of free tools available. However I personally > > find the PHP modules more usefull. (With the exception of the Crystal > > Report generator in .net, pretty usable reports without a lot of work). > > > >It's a bit easier for a novice to get started with ASP as with PHP, and > > it's pertty easy to make the project look good. > > > >So, if you have the cash and some inexperienced programmers working for > > you ASP is the save bet. If you have a small company, are a student, > > depend on webhosting or are a pretty experienced programmer, PHP might be > > a better choose. > > > >Robert Klinkenberg > > > >-- > >PHP General Mailing List (http://www.php.net/) > >To unsubscribe, e-mail: php-general-unsubscribelists.php.net > >For additional commands, e-mail: php-general-helplists.php.net > >To contact the list administrators, e-mail: php-list-adminlists.php.net

    -- 
     ( * >    Nicolas Costes,
     //\\      IUT de La Roche / Yon
    ( \/ )     Naycolaroche.univ-nantes.fr
     < <      http://luxregina.free.fr
    

    attached mail follows:


    I don't want to start a war, but last time I looked PHP had native support for every database I'd ever heard of including Oracle, SQLServer, etc...

    Just don't want the guy doing the report that php is database limited...

    On Wed, 9 Jan 2002, Robert Klinkenberg wrote:

    > Well, I personally prefer PHP over ASP because better support from > webhosting companies, but ASP has some good points. > This is especially the case if you can setup the complete hosting > environment yourself and have some money to spend. > > First of all databases. PHP has support for a limited but interesting list > of databases, especially the support for mysql and postgres is handy for a > webserver. On the other hand, ASP has good support for most bussiness > servers (ORACLE MS SQL Server,....) with OLE-DB and a lot more databases > with ODBC. > > The development tools. Definately a win for ASP (with vb.net C# and C++ you > have a complete IDE and with Dreamweaver Ultradev you can pretty much point > and click. SO you can choose whatever tool you like. > PHP has very limited IDE's. > > Price. ASP solutions are mostly build with Windows 2000 Server and MS SQL > Server or Oracle and an expensive IDE. So it's pretty expensive to build. > PHP is mostly used with Linux, Apache and MySQL and is a lot cheaper (you > only need to buy the hardware and the software is virtually free) > > Programming language: This is off course a personal taste but with ASP > (.net) you can use VB/C++/C#. So if you are used to VB or C++ it's a bit > easier to start with. > > Modules. Both have a lot of free tools available. However I personally find > the PHP modules more usefull. (With the exception of the Crystal Report > generator in .net, pretty usable reports without a lot of work). > > It's a bit easier for a novice to get started with ASP as with PHP, and it's > pertty easy to make the project look good. > > So, if you have the cash and some inexperienced programmers working for you > ASP is the save bet. If you have a small company, are a student, depend on > webhosting or are a pretty experienced programmer, PHP might be a better > choose. > > Robert Klinkenberg > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net >

    attached mail follows:


    Hi,

    I am opening a socket on a remote server(weblogic) and sending my username and psswd to authentify them...

    I figure my php is opening the socket as no errors r being trapped.. However the response is a blank page instead of an xml formatted response...why??? how can i rectify this??

    Please helpp!!!

    TIA, sands my code is as below:

    <?php

    $uname = "username"; $password = "password";

    ?>

    <?php

    $Destination = "http://srv157:7001/communicatorServlet"; $Request = "username=$uname&password=$password"; $cfgTimeOut = 20;

    $theURL = parse_url($Destination); $host = $theURL["host"]; $path = $theURL["path"]; $port = $theURL["port"]; if ($port=="") $port=80; $header = "GET ".$path." HTTP/1.0\r\n"; $header .= "Host: ".$host."\r\n"; $header .= "Accept: */*\r\n"; $header .= "Accept-Language: en\r\n"; $header .= "User-Agent: PHP/4.0.6 (Apache/1.3.20)\r\n\r\n"; $header .= "Content-Type: text/xml\r\n"; $header .= "Content-Length: ".strlen($Request)."\r\n"; $header .= "Content: \r\n\r\n"; $msg = $header . $Request; $Response = ""; // open a socket if(!$cfgTimeOut) // without timeout $fp = fsockopen($host,$port); else // with timeout $fp = fsockopen($host,$port, &$errno, &$errstr, $cfgTimeOut); if ($fp) { if (!fputs($fp,$msg,strlen($msg))) { return false; } // S E N D while (!feof($fp)) {$Response .= fgets($fp,32768);} fclose($fp); // R E C E I V E

    } else { echo "Unable to access servlet (".$Destination.").<br>"; echo "<a href=\"javascript:history.go(-1)\">Try another</a>";}

    print "$response\n"; print "hello"; ?>

    attached mail follows:


    PHPSESSID will not be set on the first request. On the first request to a page with session_start(), PHP creates a session and sends a cookie named PHPSESSID to the browser. When the browser returns the cookie in the next request, PHPSESSID gets put into $HTTP_COOKIE_VARS[] array, and if register_globals is on, it also gets put into the global variable space.

    If you need the session ID on the first request, it is availabe in the constant SID. Try putting this into your code and see what you get:

    echo "SID is " . SID . "<br>";

    I believe you can also do something like:

    $PHPSESSID = session_id(); echo "PHPSESSID is $PHPSESSID";

    Kirk

    > -----Original Message----- > From: Ryan Kelley [mailto:kelleyrinternetinvisions.com] > Sent: Tuesday, January 08, 2002 7:13 PM > To: php-generallists.php.net > Subject: Re: [PHP] Sessions > > > I actually fixed the problem with the following code: > > session_start(); > $HTTP_SESSION_VARS['sess_id']=$PHPSESSID; > > Except that it will not assign an actual value until i hit > refress on my > browser. Any ideas for a fix?

    attached mail follows:


    Hi

    I am trying to keep information that is input via a form. This form may be used 1, 2, 3, 4 or more times for each entry. Meaning that the form will be filled out and added then another of the same form filled our and so on until the person clicks the the complete button.

    Can I hold this info by session or do I have to insert it into the database after each time? I would rather not put it into the database until the session is complete and they have a chance to verify their entry.

    Thanks Kevin

    attached mail follows:


    Both ways. I would use session if the form(s) must be completed at once. If someone can save forms 1 and 2 and another day return to complete the remaining steps, then a database might be better.

    Also, if you use a database to hold temp info that must fly between the forms, you would have to write more code (of if/else { SELECT/INSERT/UPDATE/DELETE), and the performance overhead of so many db queries might not be a good idea.

    Can't afirm 100% since I don't know your complete enviroment, but from what you told and my personal experience, I would go with sessions.

    --
    

    Julio Nobrega.

    Um dia eu chego lá: http://sourceforge.net/projects/toca

    Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884

    "Kevin P" <webmasterodellwebdesign.com> wrote in message news:20020109160530.58658.qmailpb1.pair.com... > Hi > > I am trying to keep information that is input via a form. This form may be > used 1, 2, 3, 4 or more times for each entry. Meaning that the form will be > filled out and added then another of the same form filled our and so on > until the person clicks the the complete button. > > Can I hold this info by session or do I have to insert it into the database > after each time? I would rather not put it into the database until the > session is complete and they have a chance to verify their entry. > > Thanks > Kevin > >

    attached mail follows:


    Hello all:

    Our latest PHP training course is coming up soon - March 25-29 in Michigan (just outside Ann Arbor).

    Our hands-on course will take you from the basics through the intermediate stages of PHP-gurudom. :) More info can be found at http://www.tapinternet.com/php/ but I'll give a brief synopsis here for people who don't follow links...

    Our course includes continental breakfast, lunch and afternoon snacks (stick around at night and we'll bring in pizzas if you want to stay late). Each student gets a dedicated workstation with high-speed internet access, as well as access to our experienced staff (one trained educator and 2 senior software engineers with PHP experience back to 1996). Class is limited to 12 seats, to maximize hands-on Q&A time with each student.

    If you've been looking for a PHP course, this is it. We're a bit more than a couple other courses, but we deliver more

    * 30 day phone and email support followup after the class * minimum 8 hours per day of hands-on instruction * big thick manual with many examples :) * staff experienced in large scale PHP sites * a minimum of 2 instructors on-hand at all times * free meals

    This course isn't for everyone - if you're not willing to put in at least 8 hours per day of work, perhaps you should look for another course. Be prepared for more PHP than you thought possible!

    By the way, the course is held in the same building as the lodgings you would most likely stay at (trust us - stay there!) Take a look at http://www.eaglecrestresort.com.

    Most of the topics we'll cover: ------------------------------------------------------

    Introduction to PHP Getting Started Intro to Variables Environment Variables If..Elseif..Elseif Switch Statements Using Forms in PHP

    Functions Passing Vars to Functions Scope of Functions Includes and Require

    Extending Functions and Using Arrays Pre-Defined PHP Functions Using Arrays Arrays with Forms

    Intro SQL and MySQL Intro to MySQL Using PHP with MySQL

    Class and Objects Building Classes Using Classes in PHP Extending Classes

    Session Management Using Cookies Shopping Cart

    Creating Images with PHP Creating Polygons, Text, Colors Using existing images True Type Fonts and Watermarking Creating Charts, bar graphs and other data diagrams

    Database Abstraction Creating our own PEAR Example

    Templating Concepts Examples and Benefits Other templating systems

    Output Buffering

    Dynamic PDF's PDF Creation PDF Background PDF Classes

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

    If you've read this far, you may still have some questions - give us a call at 734-482-1371 or toll free at 1-866-745-3660.

    We look forward to hearing from you soon!

    Michael Kimsal http://www.tapinternet.com/php/ 734-480-9961

    attached mail follows:


    Hi,

    I am opening a socket on a remote server(weblogic) and sending my username and psswd to authentify them...

    I figure my php is opening the socket as no errors r being trapped.. However the response is a blank page instead of an xml formatted response...why??? how can i rectify this??

    Please helpp!!!

    TIA, sands my code is as below:

    <?php

    $uname = "username"; $password = "password";

    ?>

    <?php

    $Destination = "http://srv157:7001/communicatorServlet"; $Request = "username=$uname&password=$password"; $cfgTimeOut = 20;

    $theURL = parse_url($Destination); $host = $theURL["host"]; $path = $theURL["path"]; $port = $theURL["port"]; if ($port=="") $port=80; $header = "GET ".$path." HTTP/1.0\r\n"; $header .= "Host: ".$host."\r\n"; $header .= "Accept: */*\r\n"; $header .= "Accept-Language: en\r\n"; $header .= "User-Agent: PHP/4.0.6 (Apache/1.3.20)\r\n\r\n"; $header .= "Content-Type: text/xml\r\n"; $header .= "Content-Length: ".strlen($Request)."\r\n"; $header .= "Content: \r\n\r\n"; $msg = $header . $Request; $Response = ""; // open a socket if(!$cfgTimeOut) // without timeout $fp = fsockopen($host,$port); else // with timeout $fp = fsockopen($host,$port, &$errno, &$errstr, $cfgTimeOut); if ($fp) { if (!fputs($fp,$msg,strlen($msg))) { return false; } // S E N D while (!feof($fp)) {$Response .= fgets($fp,32768);} fclose($fp); // R E C E I V E

    } else { echo "Unable to access servlet (".$Destination.").<br>"; echo "<a href=\"javascript:history.go(-1)\">Try another</a>";}

    print "$response\n"; print "hello"; ?>

    -- 
    PHP Windows Mailing List (http://www.php.net/)
    To unsubscribe, e-mail: php-windows-unsubscribelists.php.net
    For additional commands, e-mail: php-windows-helplists.php.net
    To contact the list administrators, e-mail: php-list-adminlists.php.net
    

    attached mail follows:


    Probably here : $header .= "User-Agent: PHP/4.0.6 (Apache/1.3.20)\r\n\r\n"; you have two new lines instead of one.

    HTH

    Regards, Andrey Hristov ----- Original Message ----- From: "Sandeep Murphy" <Sandeep.Murphyoni.pt> To: <php-generallists.php.net> Sent: Wednesday, January 09, 2002 6:23 PM Subject: [PHP] php,sockets-help!

    > > Hi, > > I am opening a socket on a remote server(weblogic) and sending my username > and psswd to authentify them... > > I figure my php is opening the socket as no errors r being trapped.. However > the response is a blank page instead of an xml formatted response...why??? > how can i rectify this?? > > Please helpp!!! > > TIA, > sands > my code is as below: > > > <?php > > $uname = "username"; > $password = "password"; > > ?> > > > > <?php > > $Destination = "http://srv157:7001/communicatorServlet"; > $Request = "username=$uname&password=$password"; > $cfgTimeOut = 20; > > $theURL = parse_url($Destination); > $host = $theURL["host"]; > $path = $theURL["path"]; > $port = $theURL["port"]; if ($port=="") $port=80; > $header = "GET ".$path." HTTP/1.0\r\n"; > $header .= "Host: ".$host."\r\n"; > $header .= "Accept: */*\r\n"; > $header .= "Accept-Language: en\r\n"; > $header .= "User-Agent: PHP/4.0.6 (Apache/1.3.20)\r\n\r\n"; > $header .= "Content-Type: text/xml\r\n"; > $header .= "Content-Length: ".strlen($Request)."\r\n"; > $header .= "Content: \r\n\r\n"; > $msg = $header . $Request; > $Response = ""; > > > > // open a socket > if(!$cfgTimeOut) > // without timeout > $fp = fsockopen($host,$port); > else > // with timeout > $fp = fsockopen($host,$port, &$errno, &$errstr, $cfgTimeOut); > > > if ($fp) { > if (!fputs($fp,$msg,strlen($msg))) { return false; } // S > E N D > > while (!feof($fp)) {$Response .= fgets($fp,32768);} > > fclose($fp); // R E C E I V E > > } else > { > echo "Unable to access servlet (".$Destination.").<br>"; > > echo "<a > href=\"javascript:history.go(-1)\">Try another</a>";} > > print "$response\n"; > > print "hello"; > ?> > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-windows-unsubscribelists.php.net > For additional commands, e-mail: php-windows-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net > >

    attached mail follows:


    Plus, isn't your request content-type: application/x-www-form-urlencoded?

    And another thing, since you send all the headers HTTP 1.1 compatible, why don't you use it instead of 1.0?

    Bogdan

    Sandeep Murphy wrote:

    > Hi, > > I am opening a socket on a remote server(weblogic) and sending my username > and psswd to authentify them... > > I figure my php is opening the socket as no errors r being trapped.. However > the response is a blank page instead of an xml formatted response...why??? > how can i rectify this??

    attached mail follows:


    somebody can help me, does not obtain to discover because this error with postgres happens?

    Warning: PostgresSQL query failed: ERROR: pollolitoral_cidade: Permission denied. in ../php3/pg_functions.php3 on line 172 Thanks, Aurélio Sabino

    attached mail follows:


    suggestion would be to post a snippet of the relavent code... say lines 160 to 175 or something like that. Troubleshooting across the etherial plane is expensive.

    Dave

    >-----Original Message----- >From: aurelio [mailto:aureliopolloshop.com.br] >Sent: Wednesday, January 09, 2002 12:48 PM >To: php-generallists.php.net >Subject: [PHP] postgres > > >somebody can help me, does not obtain to discover because this error >with postgres happens? > > Warning: PostgresSQL query failed: ERROR: pollolitoral_cidade: >Permission denied. in ../php3/pg_functions.php3 on line 172 > >Thanks, >Aurélio Sabino >

    attached mail follows:


    try rawurlencode() and rawurldecode()

    Salu2,

    V

    -----Mensaje original----- De: nachrichtacre.de [mailto:nachrichtacre.de] Enviado el: jueves 27 de diciembre de 2001 3:46 Para: php-generallists.php.net Asunto: [PHP] problems with urlencoding

    Hi, I try to send the content of a variable about the url to the next php-page. The content of the variable is: Client like '%4022720893%' I have tried urlencode and urldecode, but this does not work If I put this variable to an url, I got always Client like '22720893%' (depending from the number after the first %), I also have tried to mask with slashes and stripslashes. But this does also not work. Who can help and has the best way to send this content thru an url best regards christian

    --
    PHP General Mailing List (http://www.php.net/)
    To unsubscribe, e-mail: php-general-unsubscribelists.php.net
    For additional commands, e-mail: php-general-helplists.php.net
    To contact the list administrators, e-mail: php-list-adminlists.php.net