OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
php-general-digest-help_at_lists.php.net
Date: Fri Jan 03 2003 - 12:10:54 CST

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

    php-general Digest 3 Jan 2003 18:10:54 -0000 Issue 1801

    Topics (messages 130052 through 130138):

    Re: Mass-mailing method
            130052 by: Michael J. Pawlowsky
            130054 by: Cesar Aracena
            130060 by: Michael J. Pawlowsky
            130065 by: Manuel Lemos
            130078 by: Paul Roberts

    DUMB QUESTION I'M SURE
            130053 by: Adam French
            130055 by: Fernando Serboncini
            130056 by: Tom Rogers
            130057 by: Cesar Aracena
            130058 by: Cesar Aracena
            130059 by: Jason k Larson
            130061 by: rw.xend.net

    Re: Timeout during SMTP operation.
            130062 by: Manuel Lemos

    returning data from a function in a class
            130063 by: Ken Nagorski
            130070 by: Jason Wong

    Re: 2 servers for mail implementation
            130064 by: Manuel Lemos
            130069 by: Rick Widmer
            130085 by: Joe Mck

    Re: PHP Testing
            130066 by: Rick Widmer

    Re: Can it be doen with Array????
            130067 by: Jason Wong

    Re: BreadCrumb Class
            130068 by: Jason Wong

    Limit to size of autoindex in MySQL/PHPMyAdmin?
            130071 by: Jim MacCormaic
            130073 by: Leif K-Brooks
            130074 by: Jasper Bryant-Greene
            130104 by: Jim MacCormaic

    Re: PHP memory usage
            130072 by: Rick Widmer

    Split that keeps delimiter
            130075 by: Simon Dedeyne

    Re: Code contents of a function
            130076 by: liljim
            130081 by: Khalid El-Kary

    ImageCreateFromPNG
            130077 by: Roy van Arem
            130080 by: Leon Mergen
            130102 by: Roy van Arem
            130105 by: Chris Hewitt
            130115 by: Chris Hewitt
            130123 by: Michael Weiner
            130126 by: Michael J. Pawlowsky
            130129 by: Michael J. Pawlowsky
            130132 by: R'twick Niceorgaw

    Re: mktime() and the format of the day number entry
            130079 by: Ford, Mike [LSS]

    Re: email/time question
            130082 by: Tularis

    include/require vs performance
            130083 by: Radek Zajkowski
            130084 by: Rasmus Lerdorf
            130086 by: Leon Mergen
            130088 by: Michael J. Pawlowsky
            130090 by: Stephan Seidt
            130092 by: Leon Mergen
            130093 by: Marek Kilimajer
            130097 by: Stephan Seidt

    newbie q: how to count words in a file
            130087 by: Tauntz
            130098 by: Khalid El-Kary
            130101 by: Tauntz

    Re: help with form adding to database!!
            130089 by: Marek Kilimajer

    How to attach a file to mail()
            130091 by: Davíğ Örn Jóhannsson

    Re: way to insert timer / pause?
            130094 by: Gerald Timothy Quimpo

    Possible bug with PHP v4.1.1 and bits?
            130095 by: Daevid Vincent
            130103 by: Marek Kilimajer
            130128 by: Ford, Mike [LSS]

    PHP-Performance
            130096 by: Fatih Üstündağ
            130099 by: Khalid El-Kary
            130100 by: Michael J. Pawlowsky

    Parsing a string
            130106 by: Greg
            130107 by: Michael J. Pawlowsky
            130109 by: Khalid El-Kary

    Re: signal handler to ignore kill of parent
            130108 by: Thomas Weber

    Loading Module not in php.ini
            130110 by: Michael J. Pawlowsky
            130111 by: Rasmus Lerdorf

    File Modification Date/Time
            130112 by: Christopher J. Crane
            130116 by: Marek Kilimajer
            130117 by: Christopher J. Crane

    Recommend payment processors?
            130113 by: Chad Day
            130118 by: Rick Emery
            130136 by: Chad Day

    [PDF Creation] Insertion of image on a PDF using EzPDF library
            130114 by: Natacha Salmon

    Re: threads (was "Re: [PHP] BreadCrumb Class")
            130119 by: David T-G
            130124 by: Michael J. Pawlowsky

    Javascript broken!
            130120 by: Adam Wilson
            130122 by: John Nichel

    Bit manipulation
            130121 by: Michael J. Pawlowsky

    installation problems (php 4.2.3/mcrypt/curl)
            130125 by: Michael Geier

    PHP intereferes with my Javascript
            130127 by: Adam Wilson
            130130 by: Michael J. Pawlowsky
            130131 by: Ford, Mike [LSS]
            130133 by: Khalid El-Kary
            130134 by: Steve Keller

    Re: Baffling output
            130135 by: Steve Keller

    PEAR extension (mailparse) not working
            130137 by: Jeff Schwartz

    Session Question
            130138 by: ed.home.homes2see.com

    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:


    Take a look at the sendmail.log for some clues...

    But I had something weird were it worked fine for me at home Linux 8 PHP 4.2.2
    and when I sent it up to the prod server I had to change the ."\r\n"; to ."\n";
    Which technically is wrong.

    Go figure!

    But take a look at the sendmail log to begin with.

    Mike

     

    *********** REPLY SEPARATOR ***********

    On 03/01/2003 at 3:08 AM Cesar Aracena wrote:

    >Hi all,
    >
    >I did a registration page for a customer, and now I'm trying to develop
    >a way for him to send an e-mail once in a while to the people registered
    >with him. I did something (shown below) and everything seems to be ok,
    >but the e-mail never reaches... Can someone find the problem or maybe
    >point me to something already done to send multiple e-mails as BCC???
    >
    >Thanks in advance,
    >
    >$query = "SELECT * FROM mararegistro2 ORDER BY lname";
    >$result = mysql_query($query) or die (mysql_errno());
    >$num_rows = mysql_num_rows($result);
    >
    >for ($x=0; $x < $num_rows; $x++)
    >{
    >$row = mysql_fetch_array($result);
    >$bcc .= $row[email]."; ";
    >}
    >
    >$myname = "".$name."";
    >$myemail = "".$email."";
    >
    >$contactemail = $bcc;
    >
    >$message = "".$mes."";
    >$subject = "".$subject."";
    >
    >$headers .= "MIME-Version: 1.0\r\n";
    >$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
    >$headers .= "From: ".$myname." <".$myemail.">\r\n";
    >$headers .= "Bcc: ".$contactemail."\r\n";
    >$headers .= "Reply-To: ".$myname." <".$myemail.">\r\n";
    >$headers .= "X-Priority: 1\r\n";
    >$headers .= "X-MSMail-Priority: High\r\n";
    >$headers .= "X-Mailer: Joyeria Mara";
    >
    >$mail = mail("", $subject, $message, $headers);
    >
    >
    >
    >Cesar L. Aracena
    >icaamicaam.com.ar
    >caracenainfovia.com.ar
    >(0299) 156-356688
    >Neuquén (8300) Capital
    >Argentina
    >
    >
    >
    >
    >--
    >PHP General Mailing List (http://www.php.net/)
    >To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    I'm going to try changing that. I don't have access to my client's
    server as I work remotely, so I can't view any logs... or can I? If
    anyone else have something for me to try, start shooting...

    Thanks,

    Cesar L. Aracena
    icaamicaam.com.ar
    caracenainfovia.com.ar
    (0299) 156-356688
    Neuquén (8300) Capital
    Argentina

    -----Mensaje original-----
    De: Michael J. Pawlowsky [mailto:mikejpvideotron.ca]
    Enviado el: viernes, 03 de enero de 2003 3:15
    Para: Cesar Aracena; php-generallists.php.net
    Asunto: Re: [PHP] Mass-mailing method

    Take a look at the sendmail.log for some clues...

    But I had something weird were it worked fine for me at home Linux 8 PHP
    4.2.2
    and when I sent it up to the prod server I had to change the ."\r\n";
    to ."\n";
    Which technically is wrong.

    Go figure!

    But take a look at the sendmail log to begin with.

    Mike

     

    *********** REPLY SEPARATOR ***********

    On 03/01/2003 at 3:08 AM Cesar Aracena wrote:

    >Hi all,
    >
    >I did a registration page for a customer, and now I'm trying to develop
    >a way for him to send an e-mail once in a while to the people
    registered
    >with him. I did something (shown below) and everything seems to be ok,
    >but the e-mail never reaches... Can someone find the problem or maybe
    >point me to something already done to send multiple e-mails as BCC???
    >
    >Thanks in advance,
    >
    >$query = "SELECT * FROM mararegistro2 ORDER BY lname";
    >$result = mysql_query($query) or die (mysql_errno());
    >$num_rows = mysql_num_rows($result);
    >
    >for ($x=0; $x < $num_rows; $x++)
    >{
    >$row = mysql_fetch_array($result);
    >$bcc .= $row[email]."; ";
    >}
    >
    >$myname = "".$name."";
    >$myemail = "".$email."";
    >
    >$contactemail = $bcc;
    >
    >$message = "".$mes."";
    >$subject = "".$subject."";
    >
    >$headers .= "MIME-Version: 1.0\r\n";
    >$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
    >$headers .= "From: ".$myname." <".$myemail.">\r\n";
    >$headers .= "Bcc: ".$contactemail."\r\n";
    >$headers .= "Reply-To: ".$myname." <".$myemail.">\r\n";
    >$headers .= "X-Priority: 1\r\n";
    >$headers .= "X-MSMail-Priority: High\r\n";
    >$headers .= "X-Mailer: Joyeria Mara";
    >
    >$mail = mail("", $subject, $message, $headers);
    >
    >
    >
    >Cesar L. Aracena
    >icaamicaam.com.ar
    >caracenainfovia.com.ar
    >(0299) 156-356688
    >Neuquén (8300) Capital
    >Argentina
    >
    >
    >
    >
    >--
    >PHP General Mailing List (http://www.php.net/)
    >To unsubscribe, visit: http://www.php.net/unsub.php

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

    attached mail follows:


    I have the same problem with one of my clients.

    I use this... Just keep it well protected... you can cat, ls, find etc. no ps for some reason.... Might also depend on server security settings. But worth a shot.

    -------------------------- STart Here ----------------------------

    <HTML> <HEAD> <TITLE></TITLE> </HEAD> <BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080">

    <?php

    if (isset($_POST['action'])) {

    echo ($_POST['cmd']); echo ("<p><hr><p>"); echo ("<pre>"); $err = 0; $result = system ($_POST['cmd'], $err); echo ("\n\n$err\n\n"); echo ("$result\n\n"); echo ("</pre>");

    } else {

    echo "<center>"; echo "<form action=\"\" enctype=\"multipart/form-data\" method=\"post\">"; echo "<input type=\"hidden\" name=\"action\" value=\"1\">";

    echo "Cmd: <input type=\"text\" name=\"cmd\" size=\"60\">"; echo "<input type=\"submit\" value=\"Submit\"></td>"; echo "</form>";

    echo ("<A HREF=\"/test/errors.php\">error log</a>"); echo "</center>"; } ?>

    </BODY> </HTML>

    ----------------------------- End Here --------------------------------

    *********** REPLY SEPARATOR ***********

    On 03/01/2003 at 3:19 AM Cesar Aracena wrote:

    >I'm going to try changing that. I don't have access to my client's >server as I work remotely, so I can't view any logs... or can I? If >anyone else have something for me to try, start shooting... > >Thanks,

    attached mail follows:


    Hello,

    On 01/03/2003 04:08 AM, Cesar Aracena wrote: > I did a registration page for a customer, and now I'm trying to develop > a way for him to send an e-mail once in a while to the people registered > with him. I did something (shown below) and everything seems to be ok, > but the e-mail never reaches... Can someone find the problem or maybe > point me to something already done to send multiple e-mails as BCC???

    I think Bcc: addresses have to be separated with commas (,). If that is not the problem, you may want to try this class that has built-in some workarounds that solve non-obvious quirks of using the mail() function. I use it to deliver in average 2 million message a month most of them with tens of thousands of recipients in Bcc:.

    http://www.phpclasses.org/mimemessage

    -- 
    

    Regards, Manuel Lemos

    attached mail follows:


    some times more than 100 bcc's are treated spam and dropped by the server, try it with a limit in the query.

    Best Wishes & Happy New Year

    Paul Roberts mailpaul-roberts.com ++++++++++++++++++++++++ ----- Original Message ----- From: "Cesar Aracena" <icaamicaam.com.ar> To: <php-generallists.php.net> Sent: Friday, January 03, 2003 6:19 AM Subject: RE: [PHP] Mass-mailing method

    I'm going to try changing that. I don't have access to my client's server as I work remotely, so I can't view any logs... or can I? If anyone else have something for me to try, start shooting...

    Thanks,

    Cesar L. Aracena icaamicaam.com.ar caracenainfovia.com.ar (0299) 156-356688 Neuquén (8300) Capital Argentina

    -----Mensaje original----- De: Michael J. Pawlowsky [mailto:mikejpvideotron.ca] Enviado el: viernes, 03 de enero de 2003 3:15 Para: Cesar Aracena; php-generallists.php.net Asunto: Re: [PHP] Mass-mailing method

    Take a look at the sendmail.log for some clues...

    But I had something weird were it worked fine for me at home Linux 8 PHP 4.2.2 and when I sent it up to the prod server I had to change the ."\r\n"; to ."\n"; Which technically is wrong.

    Go figure!

    But take a look at the sendmail log to begin with.

    Mike

    *********** REPLY SEPARATOR ***********

    On 03/01/2003 at 3:08 AM Cesar Aracena wrote:

    >Hi all, > >I did a registration page for a customer, and now I'm trying to develop >a way for him to send an e-mail once in a while to the people registered >with him. I did something (shown below) and everything seems to be ok, >but the e-mail never reaches... Can someone find the problem or maybe >point me to something already done to send multiple e-mails as BCC??? > >Thanks in advance, > >$query = "SELECT * FROM mararegistro2 ORDER BY lname"; >$result = mysql_query($query) or die (mysql_errno()); >$num_rows = mysql_num_rows($result); > >for ($x=0; $x < $num_rows; $x++) >{ >$row = mysql_fetch_array($result); >$bcc .= $row[email]."; "; >} > >$myname = "".$name.""; >$myemail = "".$email.""; > >$contactemail = $bcc; > >$message = "".$mes.""; >$subject = "".$subject.""; > >$headers .= "MIME-Version: 1.0\r\n"; >$headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; >$headers .= "From: ".$myname." <".$myemail.">\r\n"; >$headers .= "Bcc: ".$contactemail."\r\n"; >$headers .= "Reply-To: ".$myname." <".$myemail.">\r\n"; >$headers .= "X-Priority: 1\r\n"; >$headers .= "X-MSMail-Priority: High\r\n"; >$headers .= "X-Mailer: Joyeria Mara"; > >$mail = mail("", $subject, $message, $headers); > > > >Cesar L. Aracena >icaamicaam.com.ar >caracenainfovia.com.ar >(0299) 156-356688 >Neuquén (8300) Capital >Argentina > > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php

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

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

    attached mail follows:


    I'm just starting out, this is my script...

    <? $name = $_POST['username']; $name = $name; $db = mysql_connect("localhost"); mysql_select_db("vinyldealers",$db); $query = "SELECT shops.name FROM shops WHERE name = ".$name."; $result = mysql_query($query); while ($record = mysql_fetch_assoc($result)) { while (list($feildname, $feildvalue) = each ($record)) { echo $feildname. ": <B>" .$feildvalue. "</B><BR>"; } echo"<BR>"; } ?>

    This is the error I get...

    Parse error: parse error, unexpected ':' in C:\Xitami\webpages\php\result1.php on line 12

    I dunno what I'm doing wrong. Help please???

    attached mail follows:


    on the line that starts with $query = there's an extra ." the line should be: $query = "SELECT shops.name FROM shops WHERE name = ".$name;

    []s Fernando

    "Adam French" <afrenchwestman.wave.ca> wrote in message news:20030103061400.82385.qmailpb1.pair.com... > I'm just starting out, this is my script... > > <? > $name = $_POST['username']; > $name = $name; > $db = mysql_connect("localhost"); > mysql_select_db("vinyldealers",$db); > $query = "SELECT shops.name FROM shops WHERE name = ".$name."; > $result = mysql_query($query); > while ($record = mysql_fetch_assoc($result)) { > while (list($feildname, $feildvalue) = each ($record)) { > echo $feildname. ": <B>" .$feildvalue. "</B><BR>"; > } > echo"<BR>"; > } > ?> > > This is the error I get... > > Parse error: parse error, unexpected ':' in > C:\Xitami\webpages\php\result1.php on line 12 > > I dunno what I'm doing wrong. Help please??? > >

    attached mail follows:


    Hi,

    Friday, January 3, 2003, 4:18:05 PM, you wrote: AF> I'm just starting out, this is my script...

    AF> <? AF> $name = $_POST['username']; AF> $name = $name; AF> $db = mysql_connect("localhost"); AF> mysql_select_db("vinyldealers",$db); AF> $query = "SELECT shops.name FROM shops WHERE name = ".$name."; AF> $result = mysql_query($query); AF> while ($record = mysql_fetch_assoc($result)) { AF> while (list($feildname, $feildvalue) = each ($record)) { AF> echo $feildname. ": <B>" .$feildvalue. "</B><BR>"; AF> } AF> echo"<BR>"; AF> } ?>>

    AF> This is the error I get...

    AF> Parse error: parse error, unexpected ':' in AF> C:\Xitami\webpages\php\result1.php on line 12

    AF> I dunno what I'm doing wrong. Help please???

    Don't need the ." at the end of this line:

    $query = "SELECT shops.name FROM shops WHERE name = ".$name.";

    -- 
    regards,
    Tom
    

    attached mail follows:


    Try by adding a backslash to the : there (..."\: <B>"...)

    Cesar L. Aracena icaamicaam.com.ar caracenainfovia.com.ar (0299) 156-356688 Neuquén (8300) Capital Argentina

    -----Mensaje original----- De: Adam French [mailto:afrenchwestman.wave.ca] Enviado el: viernes, 03 de enero de 2003 3:18 Para: php-generallists.php.net Asunto: [PHP] DUMB QUESTION I'M SURE

    I'm just starting out, this is my script...

    <? $name = $_POST['username']; $name = $name; $db = mysql_connect("localhost"); mysql_select_db("vinyldealers",$db); $query = "SELECT shops.name FROM shops WHERE name = ".$name."; $result = mysql_query($query); while ($record = mysql_fetch_assoc($result)) { while (list($feildname, $feildvalue) = each ($record)) { echo $feildname. ": <B>" .$feildvalue. "</B><BR>"; } echo"<BR>"; } ?>

    This is the error I get...

    Parse error: parse error, unexpected ':' in C:\Xitami\webpages\php\result1.php on line 12

    I dunno what I'm doing wrong. Help please???

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

    attached mail follows:


    What they mean is to make that line:

    $query = "SELECT shops.name FROM shops WHERE name = $name";

    Cesar L. Aracena icaamicaam.com.ar caracenainfovia.com.ar (0299) 156-356688 Neuquén (8300) Capital Argentina

    -----Mensaje original----- De: Adam French [mailto:afrenchwestman.wave.ca] Enviado el: viernes, 03 de enero de 2003 3:18 Para: php-generallists.php.net Asunto: [PHP] DUMB QUESTION I'M SURE

    I'm just starting out, this is my script...

    <? $name = $_POST['username']; $name = $name; $db = mysql_connect("localhost"); mysql_select_db("vinyldealers",$db); $query = "SELECT shops.name FROM shops WHERE name = ".$name."; $result = mysql_query($query); while ($record = mysql_fetch_assoc($result)) { while (list($feildname, $feildvalue) = each ($record)) { echo $feildname. ": <B>" .$feildvalue. "</B><BR>"; } echo"<BR>"; } ?>

    This is the error I get...

    Parse error: parse error, unexpected ':' in C:\Xitami\webpages\php\result1.php on line 12

    I dunno what I'm doing wrong. Help please???

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

    attached mail follows:


    I think it's just the $query var not having the right number of quotes. I added single quotes around the value.

    <? $name = $_POST['username']; $name = $name; $db = mysql_connect("localhost"); mysql_select_db("vinyldealers",$db); $query = "SELECT shops.name FROM shops WHERE name = '".$name."'"; $result = mysql_query($query); while ($record = mysql_fetch_assoc($result)) { while (list($feildname, $feildvalue) = each ($record)) { echo $feildname. ": <B>" .$feildvalue. "</B><BR>"; } echo"<BR>"; } ?>

    HTH, Jason k Larson

    Adam French wrote: > I'm just starting out, this is my script... > > <? > $name = $_POST['username']; > $name = $name; > $db = mysql_connect("localhost"); > mysql_select_db("vinyldealers",$db); > $query = "SELECT shops.name FROM shops WHERE name = ".$name."; > $result = mysql_query($query); > while ($record = mysql_fetch_assoc($result)) { > while (list($feildname, $feildvalue) = each ($record)) { > echo $feildname. ": <B>" .$feildvalue. "</B><BR>"; > } > echo"<BR>"; > } > ?> > > This is the error I get... > > Parse error: parse error, unexpected ':' in > C:\Xitami\webpages\php\result1.php on line 12 > > I dunno what I'm doing wrong. Help please???

    attached mail follows:


    Quoting Cesar Aracena <icaamicaam.com.ar>:

    ### Try by adding a backslash to the : there (..."\: <B>"...) ### ### Cesar L. Aracena ### icaamicaam.com.ar ### caracenainfovia.com.ar ### (0299) 156-356688 ### Neuquén (8300) Capital ### Argentina ### ### ### -----Mensaje original----- ### De: Adam French [mailto:afrenchwestman.wave.ca] ### Enviado el: viernes, 03 de enero de 2003 3:18 ### Para: php-generallists.php.net ### Asunto: [PHP] DUMB QUESTION I'M SURE ### ### I'm just starting out, this is my script... ### ### <? ### $name = $_POST['username']; ### $name = $name; ### $db = mysql_connect("localhost"); ### mysql_select_db("vinyldealers",$db); ### $query = "SELECT shops.name FROM shops WHERE name = ".$name.";

    you might also want to format the above like this:

    $query = "SELECT shops.name FROM shops WHERE name = $name";

    you're gonna get an error in your sql syntax otherwise

    ### $result = mysql_query($query); ### while ($record = mysql_fetch_assoc($result)) { ### while (list($feildname, $feildvalue) = each ($record)) { ### echo $feildname. ": <B>" .$feildvalue. "</B><BR>"; ### } ### echo"<BR>"; ### } ### ?> ### ### This is the error I get... ### ### Parse error: parse error, unexpected ':' in ### C:\Xitami\webpages\php\result1.php on line 12 ### ### I dunno what I'm doing wrong. Help please??? ### ### ### ### -- ### PHP General Mailing List (http://www.php.net/) ### To unsubscribe, visit: http://www.php.net/unsub.php ### ### ### -- ### PHP General Mailing List (http://www.php.net/) ### To unsubscribe, visit: http://www.php.net/unsub.php ### ###

    attached mail follows:


    Hello,

    On 01/02/2003 06:02 PM, Gilrain wrote: > I've just finished a PHP/MySQL mailing list. Basically, I'm having problems > with my sendmail function. It takes an array of e-mail addresses > ($addresses) and loops through it, e-mailing each one using an SMTP class I > found (the only identifying comment in it is "SMTP Class By TOMO > (2001/09/14)"). The problem is, it's very slow. The typical array of > addresses sent to this is 100 to 500 elements large. The actual mailing list > has over 7000 members, but the e-mails are sent out to a geographical > region. Ideally, though, this function should be able to handle mailing to > the entire member base. > > Here's the offending function (with private stuff altered). Currently, it > will only send to about 50 of the addresses before Internet Explorer times > out and cuts it off (perhaps five minutes or so). Note that this is without > catches, so it skips to the 'else'. > > If I comment out the sending part, as shown, the operation takes a split > second and the log is written correctly, so I know the problem lies in the > sending of the mail. The only solution I can think of is to make the user > send things in chunks of 50 or so addresses, but I'd like to avoid this > inconvenience if I can. Any ideas?

    Using SMTP to deliver messages is a bad idea unless you do not have an option, like you are under Windows. Under Unix/Linux it is better inject the messages in the local mailer queue and have it to do the bulk delivery.

    In that case you may want to try this class that comes with sub-classes that let you configure details of delivery depending on your local mailer.

    http://www.phpclasses.org/mimemessage

    -- 
    

    Regards, Manuel Lemos

    attached mail follows:


    Hi there,

    I am totally new at classes and oop... I have never done any object oriented stuff before so I don't know if my question is a php one, a browser issue or an oop one but here goes. I am writing a class that deals with members for a site (I know there are examples on the web, I have used pieces parts from them...) and things seem to be going ok (actually better than OK, I have totally amazed myself so far). but I have one issue. I have a function in the class that returns the session ID if there is a valid session. otherwise it returns 0. This function works fine in IE6 however fails in mozilla or lynx. I have NO idea why and can't seem to figure out where to even start.

    I would really appreciate any advice. I have included the code snippits below.

    -- from class.session_logger.php ------------------ function is_logged_in() { session_start(); $this->current_session_id=session_id(); $db_vars = new db_vars; $sql_connection = mysql_connect($db_vars->db_server, $db_vars->db_user, $db_vars->db_pass); if($sql_connection) { $db_connection = mysql_select_db($db_vars- >db_dbname, $sql_connection); $sql_query = "select sessionid from session where sessionid='$this->current_session_id'"; $query_result = mysql_query($sql_query); if($row=mysql_fetch_array($query_result, MYSQL_ASSOC)) { return $row[sessionid]; } else { return 0; } } } -------------------------------------------------------------------

    ------- how I have calling this -------------------------

    $session_logger = new session_logger; $session_id=$session_logger->is_logged_in(); //echos the session id in IE6, echos 0 in Mozilla ??? echo("<B> la la la $session_id</B>><br>");

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

    Thanks kenn

    attached mail follows:


    On Friday 03 January 2003 14:40, Ken Nagorski wrote: > Hi there, > > I am totally new at classes and oop... I have never done any object > oriented stuff before so I don't know if my question is a php one, a > browser issue or an oop one but here goes. I am writing a class that deals > with members for a site (I know there are examples on the web, I have used > pieces parts from them...) and things seem to be going ok (actually better > than OK, I have totally amazed myself so far). but I have one issue. I have > a function in the class that returns the session ID if there is a valid > session. otherwise it returns 0. This function works fine in IE6 however > fails in mozilla or lynx. I have NO idea why and can't seem to figure out > where to even start.

    As always, the best thing to do when code doesn't behave as expected is to start printing out variables to see whether they contain what you expect them to contain ...

    > I would really appreciate any advice. I have included the code snippits > below. > > -- from class.session_logger.php ------------------ > function is_logged_in() > { > session_start(); > $this->current_session_id=session_id();

    ... eg what does $this-current_session_id contain now? Most likely it is empty, ...

    > $session_logger = new session_logger; > $session_id=$session_logger->is_logged_in(); > //echos the session id in IE6, echos 0 in Mozilla ??? > echo("<B> la la la $session_id</B>><br>");

    ... probably because Mozilla is not accepting cookies?

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

    /* If you sit down at a poker game and don't see a sucker, get up. You're the sucker. */

    attached mail follows:


    Hello,

    On 01/03/2003 01:11 AM, Roger Thomas wrote: > dear all, > i have 2 servers that were *given* to me to setup and implement webmail > solution for our client. i have done some groundwork in terms of the backend > applications that are needed to do this. > > what i wanted to know is, how best can i distribute the backend applications > between those 2 servers to achieve a balance and fast response. can i go like > this: > > server A > -------- > ldap > courier-imap > > server B > -------- > apache > php > qmail

    No I suggest that you use just one server the Web and receiving e-mail and the other server for delivering e-mail. In the Web server configure qmail smtproutes control variable pointing to the other server that will only allow relaying messages from the Web server.

    -- 
    

    Regards, Manuel Lemos

    attached mail follows:


    At 07:11 PM 1/2/03 -0800, Roger Thomas wrote: >dear all, >i have 2 servers that were *given* to me to setup and implement webmail >solution for our client. i have done some groundwork in terms of the backend >applications that are needed to do this.

    This doesn't have much to do with PHP. In fact it can probably be done without PHP.

    The ideal setup depends on your situation. How many domans? How many users? How much email?

    If you have multiple domains, I suggest you look at

    http://inter7.com/freesoftware/

    They have a complete package to manage multiple virtual domains on a Qmail server using only one system user. I've been using it for a couple years, with good luck. There is an active development effort

    If I was going to setup two machines as mail servers, I would put half the users on each, with all the programs running on both. Then I would setup MX records so that each server backed up the other, collecting email for later delivery if the other server is down. This way if one of the machines goes down, half your users still get mail, and the messages for the other half are queued on the remaining server.

    Be sure to keep a backup copy of one machine's configuration on the other. You should have everything you need to re-build a dead server on the other machine. If you put the user mailboxes and mail queue on separate hard drives you can pop that drive from one machine to another very quickly.

    You can run Apache on the mail server to manage email accounts, and for webmail, but keep all non-mail related web services off of it. You don't want all the web developers logging on to the mail server.

    Rick

    attached mail follows:


    Hi,

    > At 07:11 PM 1/2/03 -0800, Roger Thomas wrote: > >dear all, > >i have 2 servers that were *given* to me to setup and implement webmail > >solution for our client. i have done some groundwork in terms of the backend > >applications that are needed to do this. > > > This doesn't have much to do with PHP. In fact it can probably be done > without PHP. > > The ideal setup depends on your situation. How many domans? How many > users? How much email? > > > If you have multiple domains, I suggest you look at > > http://inter7.com/freesoftware/ > > > They have a complete package to manage multiple virtual domains on a Qmail > server using only one system user. I've been using it for a couple years, > with good luck. There is an active development effort > > > If I was going to setup two machines as mail servers, I would put half the > users on each, with all the programs running on both. Then I would setup > MX records so that each server backed up the other, collecting email for > later delivery if the other server is down. This way if one of the > machines goes down, half your users still get mail, and the messages for > the other half are queued on the remaining server.

    I think it would be more efficient putting all the users on one box, with it hd doing raid, and the other box doing the processing. so, if something happens on my storage server (the one who has the mails) i would just need to replace the server (or one of the hd's) reducing time response. And if i need more processing (lets say, i get 100% more visits than when i builded this), i would just need to add another proc server and do load balancing trough DNS. To share the mail data you may use NFS.

    > > Be sure to keep a backup copy of one machine's configuration on the > other. You should have everything you need to re-build a dead server on > the other machine. If you put the user mailboxes and mail queue on > separate hard drives you can pop that drive from one machine to another > very quickly. > > > You can run Apache on the mail server to manage email accounts, and for > webmail, but keep all non-mail related web services off of it. You don't > want all the web developers logging on to the mail server.

    Maybe running all the services in one server wont be a problem if you configure all the system properly, your developers may need to read mails from console for development reasons anyways. I think that maybe you could put the POP3 server on the storage and SMTP/HTTP on the proc server. It deppends on the hardware of the two boxes and the amount of users that will use the system.

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

    Excuse my english. Jou.

    attached mail follows:


    At 05:25 PM 1/2/03 -0800, Jim Lucas wrote:

    ><VirtualHost *> > DocumentRoot /some/path/public_html > php_admin_value engine On

    try

    php_admin_value php_engine on|off

    Rick

    attached mail follows:


    On Friday 03 January 2003 06:15, Scott Fletcher wrote: > Thanks! I looked it up on the php.net and I wasn't sure if I understood > it, so I post it here instead. Thanks for hte response.

    It begs the question -- why didn't you just try out the code you posted? It surely would've been much quicker than asking on the list?

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

    /* The verdict of a jury is the a priori opinion of that juror who smokes the worst cigars. -- H. L. Mencken */

    attached mail follows:


    On Friday 03 January 2003 11:50, Michael J. Pawlowsky wrote: > I was wondering if anyone had a good BreadCrumb class. > If not I will write my own, but thought surely there must be many out > there. But quick searches only brought up "Poof" which is more than I want.

    You have started a new thread by taking an existing posting and replying to it while you changed the subject.

    That is bad, because it breaks threading. Whenever you reply to a message, your mail client generates a "References:" header that tells all recipients which posting(s) your posting refers to. A mail client uses this information to build a threaded view ("tree view") of the postings.

    With your posting style you successfully torpedoed this useful feature; your posting shows up within an existing thread it has nothing to do with.

    Always do a fresh post when you want to start a new thread. To achieve this, click on "New message" instead of "Reply" within your mail client, and enter the list address as the recipient. You can save the list address in your address book for convenience.

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

    /* You will gain money by an illegal action. */

    attached mail follows:


    Hi all. I'm new here, currently implementing my first PHP/MySQL website on an iMac running Mac OS X v.10.2.3.

    All has been going really well until just now while I was adding records to the MySQL database. I have a table which includes an auto-incremented field which is set as the Primary key. I was happily entering information and then suddenly got a warning of an error in my MySQL query, telling me that I had a 'duplicate entry "255" for key 1'.

    I've checked the relevant table in PHPMyAdmin and, sure enough, under Row Statistic in the Structure option it gives a value of 255 for the Next Autoindex even though that value was already assigned in the previous record. I feel as if I've hit a brick wall on this one. I ran Check Table, Analyze Table and Optimize Table in PHPMyAdmin Operations and all reported 'OK'. I'm using a PHP form to insert the records and have code included to print out the MySQL query and to report errors (hence the warning which I received). The field in question is of type tinyint(4), unsigned, not NULL and, as stated, is the Primary key and set to auto-increment.

    Have I hit some sort of limit by reaching an id of 255? If so, can I fix this? Any help would be appreciated, as my database has to all intents and purposes lost its functionality once I cannot add further records.

    Jim MacCormaic Dublin, Ireland iChat/AIM : curlytoolmac.com

    attached mail follows:


    The limit to tinyint is 255... use int.

    Jim MacCormaic wrote:

    > Hi all. I'm new here, currently implementing my first PHP/MySQL > website on an iMac running Mac OS X v.10.2.3. > > All has been going really well until just now while I was adding > records to the MySQL database. I have a table which includes an > auto-incremented field which is set as the Primary key. I was happily > entering information and then suddenly got a warning of an error in my > MySQL query, telling me that I had a 'duplicate entry "255" for key 1'. > > I've checked the relevant table in PHPMyAdmin and, sure enough, under > Row Statistic in the Structure option it gives a value of 255 for the > Next Autoindex even though that value was already assigned in the > previous record. I feel as if I've hit a brick wall on this one. I ran > Check Table, Analyze Table and Optimize Table in PHPMyAdmin Operations > and all reported 'OK'. I'm using a PHP form to insert the records and > have code included to print out the MySQL query and to report errors > (hence the warning which I received). The field in question is of type > tinyint(4), unsigned, not NULL and, as stated, is the Primary key and > set to auto-increment. > > Have I hit some sort of limit by reaching an id of 255? If so, can I > fix this? Any help would be appreciated, as my database has to all > intents and purposes lost its functionality once I cannot add further > records. > > Jim MacCormaic > Dublin, Ireland > iChat/AIM : curlytoolmac.com > >

    -- 
    The above message is encrypted with double rot13 encoding.  Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.
    

    attached mail follows:


    Jim MacCormaic wrote:

    > Hi all. I'm new here, currently implementing my first PHP/MySQL > website on an iMac running Mac OS X v.10.2.3. > > All has been going really well until just now while I was adding > records to the MySQL database. I have a table which includes an > auto-incremented field which is set as the Primary key. I was happily > entering information and then suddenly got a warning of an error in my > MySQL query, telling me that I had a 'duplicate entry "255" for key 1'. > > I've checked the relevant table in PHPMyAdmin and, sure enough, under > Row Statistic in the Structure option it gives a value of 255 for the > Next Autoindex even though that value was already assigned in the > previous record. I feel as if I've hit a brick wall on this one. I ran > Check Table, Analyze Table and Optimize Table in PHPMyAdmin Operations > and all reported 'OK'. I'm using a PHP form to insert the records and > have code included to print out the MySQL query and to report errors > (hence the warning which I received). The field in question is of type > tinyint(4), unsigned, not NULL and, as stated, is the Primary key and > set to auto-increment. > > Have I hit some sort of limit by reaching an id of 255? If so, can I > fix this? Any help would be appreciated, as my database has to all > intents and purposes lost its functionality once I cannot add further > records. > > Jim MacCormaic > Dublin, Ireland > iChat/AIM : curlytoolmac.com > > Change the field type from TINYINT to SMALLINT or MEDIUMINT. UNSIGNED TINYINT only has a range of 0 thru 255.

    Regards.

    Jasper Bryant-Greene http://fatal.kiwisparks.co.nz/


    attached mail follows:


    On Friday, January 3, 2003, at 08:59 am, Leif K-Brooks wrote:

    > The limit to tinyint is 255... use int.

    On Friday, January 3, 2003, at 09:02 am, Jasper Bryant-Greene wrote:

    > Change the field type from TINYINT to SMALLINT or MEDIUMINT. UNSIGNED > TINYINT only has a range of 0 thru 255.

    Thanks so much guys. I've made the change, tried again, and all is well. I opted for SMALLINT because its range is more than adequate for my needs. Whew! Relief!

    Sorry for not thinking of going first to the source. Having read your posts I went back to the MYSQL manual and checked out Column Types. In my defence all I can say is that I'll remember it better this way ;-)

    Jim MacCormaic Dublin, Ireland iChat/AIM : curlytoolmac.com

    attached mail follows:


    At 01:25 AM 1/3/03 -0200, Fernando Serboncini wrote:

    >function a(myclass c) >{ > return c; >} > >would create another copy of "c" in memory. Things get a bit larger when you >go with linked-list like structures in classes, where you have to take >really good care to don't duplicate data. If you're not taking care, then >maybe 5MB is normal.

    Not really. PHP has its own method of handling variables which does not make a copy of data unless it has to. See:

    http://www.zend.com/zend/art/ref-count.php

    This may be the most important paragraph in the article:

    Note that PHP 4 is not like C: passing variables by reference is not necessarily faster than passing them by value. Indeed, in PHP 4 it is usually better to pass a variable by value, except if the function changes the passed value or if a reference is being passed.

    Rick

    attached mail follows:


    Is there a way to split a string without using something like this: $keywords=preg_split("/[?!.]/", "this ! Is a possible test",PREG_SPLIT_DELIM_CAPTURE); My php version doesn't seem to support the flags, and I want to know which delimiter the string was splitted by.

    Kind regards,

    Simon De Deyne

    attached mail follows:


    Output buffering functions sound like something you could use:

    <?php

    function OtherStuff() { echo "MONKEY!!!<br>\n"; }

    function DoStuff() { echo "Something<br>\n"; echo "Something else<br>\n"; OtherStuff(); }

    // Start output buffering. ob_start();

    // Grab the content. DoStuff(); $content = ob_get_contents();

    // Finish up. ob_end_clean();

    // What to do with $content? echo "Content is: <b>" . $content . "</b>\n";

    ?>

    However, this could get messy and might not be what you're really after. If you're just wanting to return values from your functions, use return:

    function OtherStuff() { return "Monkey!<br>\n"; }

    function DoStuff() { $output = "Something<br>\n"; $output .= "Something else<br>\n"; $output .= OtherStuff();

    return $output; }

    $content = DoStuff();

    echo "Content = " . $content;

    would have a similar effect to the output method above.

    Anyway, further reference for you on output buffering can be found here: http://www.php.net/manual/en/ref.outcontrol.php

    -James

    "Shawn McKenzie" <nospammckenzies.net> wrote in message news:20030103011755.98000.qmailpb1.pair.com... > I have a script with some functions and within the script I want to read the > code from one of the functions into a string. > > Example: > > function myfunction() { > echo "something"; > echo "something else"; > someotherfunction(); > } > > I want to read: > > echo "something"; > echo "something else"; > someotherfunction(); > > into a string. > > Any ideas??? TIA > -Shawn > >

    attached mail follows:


    although i never needed to do such a thing, but you can open the PHP file with the file system functions fopen,fread,fgets ... and work with it using string functions strpos(),substr() ...

    File system functions: http://www.php.net/manual/en/ref.filesystem.php String functions: http://www.php.net/manual/en/ref.strings.php

    good luck!

    Regrads, Khalid Al-Kary

    >What??? I want to read the code from the function into a string! > >"Peter Houchin" <phpvfsa.com.au> wrote in message >news:DPEPKCNEFOKBCNNANCIPAEHGDDAA.phpvfsa.com.au... > > so put it in a if or switch statement > > > > eg > > > > if ($var){ > > myfunction(); > > } > > else { > > sumotherfunction(); > > } > > > > etc > > > > > > > -----Original Message----- > > > From: Shawn McKenzie [mailto:nospammckenzies.net] > > > Sent: Friday, 3 January 2003 12:18 PM > > > To: php-generallists.php.net > > > Subject: [PHP] Code contents of a function > > > > > > > > > I have a script with some functions and within the script I want > > > to read the > > > code from one of the functions into a string. > > > > > > Example: > > > > > > function myfunction() { > > > echo "something"; > > > echo "something else"; > > > someotherfunction(); > > > } > > > > > > I want to read: > > > > > > echo "something"; > > > echo "something else"; > > > someotherfunction(); > > > > > > into a string. > > > > > > Any ideas??? TIA > > > -Shawn > > > > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php

    _________________________________________________________________ The new MSN 8 is here: Try it free* for 2 months http://join.msn.com/?page=dept/dialup

    attached mail follows:


    ImageCreateFromPNG does not work ...

    I use php4.3 on win2000 and ImageCreateFromPNG give an error... undefined function... how is that possible... can someone help me

    attached mail follows:


    You haven't compiled PHP with png support.

    "Roy Van Arem" <rddGheos.com> schreef in bericht news:3E1555DE.68DB512BGheos.com... > ImageCreateFromPNG does not work ... > I use php4.3 on win2000 and ImageCreateFromPNG give an error... > undefined function... how is that possible... can someone help me

    attached mail follows:


    ImageCreateFromPNG just won't work in php4.3 on windows 2000 . . . .I cannot find any information on that ... can someone help me?? please....

    Roy van Arem rddGheos.com

    attached mail follows:


    Roy van Arem wrote:

    >ImageCreateFromPNG just won't work in php4.3 on windows 2000 . . . .I >cannot find any information on that ... can someone help me?? please.... > Does phpinfo() show that you have png support enabled (in gd section)? I'm working with php 4.1.2 (on linux) so things may differ with the built-in gd in 4.3.

    What error message, if any, do you get?

    HTH Chris

    >

    attached mail follows:


    Roy van Arem wrote:

    >In gd section..... hm... I always used to use PHP 3. something and that >didn't have half the variables I can set in php4.3...... anyway this is >phpinfo: > >http://62.142.245.64/g/gheos.com/test.php > No gd section or png mentioned on that page.

    ><br /> ><b>Fatal error</b>: Call to undefined function: imagecreatefrompng() in > This error message is telling you that gd was not entered in the ./configure stage of compiling php.

    >If I put exactly the same script on my ISP's server, then it works without >any problem! >But on my pc it just does not! > If you look at a phpinfo() on your isp's server then gd must be present.

    You need to recompile php, or get a distribution of it with gd present. As I only use php under linux I'm not the best person to advise where to get a suitable set of windows binaries. I suggest a search of the archives of this list as this question comes up occasionally, or try a google search. (Of course you could just load linux, but I guess that is not the answer you are looking for :-)

    Hope this helps

    Chris

    attached mail follows:


    Does someone have a script of php function or page that has this code working that i can review? I am wanting to create a webpage that will let a user enter in an image name (i.e. a png or whatever) and have php create an image from that...

    Thanks in advance Michael Weiner

    attached mail follows:


    I have something that does it but only with gif since I have the old version of GDLib. But everthing is the same except for the output and the opening from a specific file.. It's not exactly what you are looking for but it will get you started.... I use a db clas for my db calls so dont try and use does. You will have to change them.

    I also build some images on the fly from data....

    Take a look at http://www.rconline.ca/wind/index.php?id=1&club_id=0

    It is built on the fly using GDLib

    <?php

    require("/lib/util.php"); $sql = new MySQL_class; $sql->Create("mydb");

    if (isset($_POST['action'])) {

    /* Update the database records */

    $sql->Insert("INSERT INTO photo_item (unum, cat, cutline, create_date, hsize, vsize) VALUES ( $HTTP_COOKIE_VARS[unum], $_POST[cat], '$_POST[cutline]', now(), 0,0)");

    $affected_rows = $sql->a_rows; $lastid = mysql_insert_id();

    /* If we have an photo let's move it */ if (is_uploaded_file($_FILES['userfile']['tmp_name'])) { move_uploaded_file($_FILES['userfile']['tmp_name'], "pics/$lastid.gif"); } else { /* No photo then send error and delete db entry */ $sql->Delete("DELETE from photo_item where id = $lastid"); echo ("Error no photo uploaded"); Die(); }

    $imagehw = GetImageSize("pics/$lastid.gif");

    $imagewidth = $imagehw[0]; $imageheight = $imagehw[1]; $imagetype = $imagehw[2];

    if ($imagetype != 1) { $sql->Delete("DELETE from photo_item where id = $lastid"); $err = unlink ("pics/$lastid.gif"); echo ("Photos must be of type .GIF"); Die(); }

    // Make sure the pic is at least 250X175 if (($imageheight < 250) AND ($imagewidth < 175)) { $sql->Delete("DELETE from photo_item where id = $lastid"); $err = unlink ("pics/$lastid.gif"); echo ("Photos should be a minimum of 250x175 pixels"); Die(); }

    if (($imageheight < 175) AND ($imagewidth < 250)) { $sql->Delete("DELETE from photo_item where id = $lastid"); $err = unlink ("pics/$lastid.gif"); echo ("Photos should be a minimum of 250x175 pixels"); Die(); }

    // Create or source image for scaling and thumbnail $src_img=ImageCreateFromGif("pics/$lastid.gif");

    if (($imageheight > 600) or ($imagewidth > 600)) { // We need to scale it if ($imageheight > $imagewidth) { // We have a vertical $hscale = ($imageheight / 600); $new_w = round($imageheight / $hscale); $new_h = round($imageheight / $hscale); } else { // We have a horizontal or square $hscale = ($imagewidth / 600); $new_w = round($imagewidth / $hscale); $new_h = round($imageheight / $hscale); }

    $dst_img=ImageCreate($new_w,$new_h); ImageCopyResized($dst_img,$src_img,0,0,0,0,$new_w,$new_h,$imagewidth,$imageheight); ImageGif($dst_img, "pics/$lastid.gif"); ImageDestroy($dst_img);

    } else { // Keep original dimensions $new_w = $imagewidth; $new_h = $imageheight; }

    // Let's see if it's vertical or horizontal and create thumbnail scale if ($imageheight > $imagewidth) { // We have a vertical $tscale = ($imageheight / 250); $new_tw = round($imagewidth / $tscale); $new_th = round($imageheight / $tscale); } else { // We have a horizontal or square $tscale = ($imagewidth / 250); $new_tw = round($imagewidth / $tscale); $new_th = round($imageheight / $tscale); }

    // Make the thumbnail $t_img=ImageCreate($new_tw,$new_th); ImageCopyResized($t_img,$src_img,0,0,0,0,$new_tw,$new_th,$imagewidth,$imageheight); ImageGif($t_img, "pics/t$lastid.gif"); // Clean house ImageDestroy($t_img); ImageDestroy($src_img);

    $sql->Update("update photo_item set hsize = $new_w, vsize = $new_h where id = $lastid"); header("Location: /photos/index.php");

    } else {

    echo "<HTML>"; echo "<HEAD>"; echo "<TITLE>Photo Add</TITLE>"; echo "<link href=\"/style.html\" rel=\"stylesheet\" type=\"text/css\">"; echo "</HEAD>"; echo "<BODY background=\"/images/main-bg.jpg\" bgproperties=\"fixed\">";

    echo "<center>";

    echo "<h1>Add a photo</h1>\n<p>\n\n";

    echo "<form action=\"\" enctype=\"multipart/form-data\" method=\"post\">"; echo "<input type=\"hidden\" name=\"action\" value=\"1\">"; echo "<TABLE border=\"0\">";

    echo "<tr>"; echo "<td colspan=\"2\"><img src=\"/images/bpix.gif\" width=\"100%\" height=\"2\"></td>"; echo "</tr>";

    echo "<tr>"; echo "<td>Category: </td> <td><select name=\"cat\">";

    $sql2 = new MySQL_class; $sql2->Create("mydb"); $sql2->Query("Select id, name from photo_cat order by id"); for ($i = 0; $i < $sql2->rows; $i++) { $sql2->Fetch($i); $id = $sql2->data[id]; $name = $sql2->data[name]; echo("<OPTION VALUE=\"$id\">$name\n"); }

    echo "</select>"; echo "</td>"; echo "</tr>";

    echo "<tr>"; echo "<td valign=\"top\">Cutline:</td> <td><textarea cols=\"50\" rows=\"10\" name=\"cutline\"></textarea></td>"; echo "</tr>";

    echo "<tr><td>"; echo "<input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"1000000\">"; echo "Photo: </td> <td><input name=\"userfile\" type=\"file\">"; echo "</td></tr>";

    echo "<tr><td> </td><td>"; echo "<br>Images should be of type .gif"; echo "<br>Resolution should be 75 dpi"; echo "<br>Weight cannot exceed 1Mb"; echo "<br>If possible keep a 3x2 ratio. (600x400 pixels is optimum)"; echo "</td></tr>";

    echo "<tr>"; echo "<td colspan=\"4\"><img src=\"/images/bpix.gif\" width=\"100%\" height=\"2\"></td>"; echo "</tr>";

    echo "<tr>"; echo "<td colspan=\"4\" align=\"center\"><input type=\"submit\" value=\"Submit\"></td>"; echo "</tr>";

    echo "</table>"; echo "</form>"; echo "</center>";

    echo "</BODY>"; echo "</HTML>"; } ?>

    *********** REPLY SEPARATOR ***********

    On 03/01/2003 at 11:58 AM Michael Weiner wrote:

    >Does someone have a script of php function or page that has this code >working that i can review? I am wanting to create a webpage that will >let a user enter in an image name (i.e. a png or whatever) and have php >create an image from that... > >Thanks in advance >Michael Weiner > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    Oops... thought you wanted them to upload a file...

    So here something else... just modify it to your needs.... It' the code to the URL I sent you...

    <?php

    header("Content-type: image/gif");

    // Define some constants here (I know they are vars) $imagewidth = 400; $imageheight = 400;

    $img = imagecreate($imagewidth, $imageheight);

    // Let's define some colours $white = ImageColorAllocate($img, 255, 255, 255); $blue = ImageColorAllocate($img, 0, 0, 255); $black = ImageColorAllocate($img, 0, 0, 0); $grey = imagecolorallocate($img, 128,128,128); $navy = imagecolorallocate($img, 0,0,128);

    // Define patterns (Styles) $dash=array($white,$white,$white,$white,$white,$white,$white,$white,$white,$white,$white,$white,$white,$white,$white,$white,$white,$white,$white,$white,$grey,$grey,$grey,$grey,$grey,$grey,$grey,$grey,$grey,$grey,$grey,$grey,$grey,$grey,$grey);

    // Define bit map font $run0 = imageloadfont("/var/sites/rconline.ca/web/wind/run0.gdf"); $run180 = imageloadfont("/var/sites/rconline.ca/web/wind/run180.gdf");

    //------------------------------------------- // Ready to go -- Lets create an image //-------------------------------------------

    // Draw the runway imagefilledrectangle ($img, 150, 0, 250, 400, $black); imagefilledrectangle ($img, 154, 4, 246, 396, $grey);

    //Add the wind speeds ImageString($img, 5, 178, 185, Hello", $blue);

    Imagegif($img); // Imagejpeg($img); ImageDestroy($img);

    ?>

    *********** REPLY SEPARATOR ***********

    On 03/01/2003 at 11:58 AM Michael Weiner wrote:

    >Does someone have a script of php function or page that has this code >working that i can review? I am wanting to create a webpage that will >let a user enter in an image name (i.e. a png or whatever) and have php >create an image from that... > >Thanks in advance >Michael Weiner > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    I have something that I use to create simple buttons. I use the command line interface version of php to create the buttons offline. However, the function can also be used on an web application easily. I am creating the image with fixed height and width, you can change it by using $i_width and $i_height variables in call to ImageCreate / ImageRectangle/ImageFtText function.

    Change it as you like. One thing, is the fontfile has to be an absolute file path.

    HTH -R'twick ------------------------------------ Code ----------------------------------- #!/usr/local/bin/php-cli <?php function create_image($string,$name) { $pointsize = 15; $fontfile = "/usr/local/fonts/arial.ttf"; $imagefile=$name.".png";

    $string_size = ImageFtBbox($pointsize, 0, $fontfile, $string, array("linespacing" => 1)); $s_width = $string_size[4]; $s_height = $string_size[5]; $i_width = $s_width+2; $i_height = -1 * $s_height+2;

    $im = imagecreate(115, 22); $white = imagecolorallocate ($im, 255, 255, 255); $black = imagecolorallocate ($im, 0,0 ,0); ImageRectangle ( $im, 0,0, 114, 21,$black);

    ImageFtText($im, $pointsize, 0, (122 - $s_width)/2 - 1, 22-(22+$s_height)/2, $black, $fontfile, $string, array("linespacing" => 1));

    ImagePNG ($im,$imagefile); ImageDestroy ($im); } if ($argc <3) {

    echo "usage: ". $argv[0]." <text> <filename>\n"; exit (-1); } create_image ($argv[1],$argv[2]); ?> ---------------------------- End Code --------------------------------------- ----- Original Message ----- From: "Michael Weiner" <hunteruserfriendly.net> To: <php-generallists.php.net> Cc: <rddgheos.com> Sent: Friday, January 03, 2003 11:58 AM Subject: [PHP] ImageCreateFromPNG

    > Does someone have a script of php function or page that has this code > working that i can review? I am wanting to create a webpage that will > let a user enter in an image name (i.e. a png or whatever) and have php > create an image from that... > > Thanks in advance > Michael Weiner > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

    attached mail follows:


    > -----Original Message----- > From: Johnson, Kirk [mailto:kjohnsonzootweb.com] > Sent: 02 January 2003 23:29 > > The month behaves the same: both '08' and '09' are treated as zero by > mktime().

    A leading 0 on a number denotes it as octal. 08 and 09 are not valid octal numbers. PHP is interpreting as much of the number as it can (i.e. the leading 0) and ignoring the invalid part. This gives you your zero results.

    Cheers!

    Mike

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

    attached mail follows:


    Since PHP is a languaged that work with user-activation, it would only be possible with an infinitive loop, and a constant time check.

    PHP needs some user interaction before it can start processing. That's the entire basis. As such, it IS techinally possible to do what you said, but is also something that is really NOT recommended to do with php.

    The other possiblity is to set a cron job to fire up a script which will send the email.

    - Tularis

    Randy Johnson wrote: > Here is what i need to do. > > > > I have a form where a user will submit, email address, email text and a time > like 11:15pm and at 11:15pm the email is supposed to be sent out. any > ideas on how i can make this happen automatically??? > > > > > > Randy >

    attached mail follows:


    i am designing a small app that obviuosly works best when I have a lot of global files with functions, which cut down on editing.

    I will likely have a main page that will contain modules and also load all of the required includes like config etc. in total some 10 files will be reqested.

    Is there, was there ever issue around including a lot files via include(). I am running things on a local server so it's hard to gauge.

    Thansk in advance.

    R>

    ___________________________________ Radoslaw Zajkowski http://www.finalbanana.com

    attached mail follows:


    > Is there, was there ever issue around including a lot files via > include(). I am running things on a local server so it's hard to gauge.

    I don't understand that comment. includes/requires are always (well nearly anyway) local to the server regardless of where the request is coming from. So if you have a test box and it is fast enough for you, then go with it.

    -Rasmus

    attached mail follows:


    "Radek Zajkowski" <infofinalbanana.com> schreef in bericht news:php.general-130083news.php.net... > Is there, was there ever issue around including a lot files via > include(). I am running things on a local server so it's hard to gauge.

    I think that the only source that could cause any problems with too many files included will be your operating system (since that thing has certain limitations on a max number of locked files for example) . Other than that, I don't think so. I myself include about 15 files on certain pages. But it is easy to make a test or anything...

    Just make a PHP script that generates like 1000 php scripts called "include.test.x.php" , where x is is a number, then the contents of those scripts should by "<? include("include.test." . (x+1) . ".php");?>" or something like that...

    Then you are for sure, and you immediately also know how much performance is lost for including 1000 files :)

    attached mail follows:


    These files are parsed by the interpreter... They are not sent to the client, so I you are thinking bandwidth I dont see how it would affect it. Unless they all output a bunch of data.

    Of course there will be some overhead for PHP to interpret all that code.

    Mike

    *********** REPLY SEPARATOR ***********

    On 03/01/2003 at 8:25 AM Radek Zajkowski wrote:

    >i am designing a small app that obviuosly works best when I have a lot of >global files with functions, which cut down on editing. > >I will likely have a main page that will contain modules and also load >all of the required includes like config etc. in total some 10 files will >be reqested. > >Is there, was there ever issue around including a lot files via >include(). I am running things on a local server so it's hard to gauge. > >Thansk in advance. > >R> > >___________________________________ >Radoslaw Zajkowski >http://www.finalbanana.com > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    I guess that PHP will close file 1 before it opens file 2 and so on.. For example :

    include 'foo'; include 'bar';

    When bar is being opened foo is already closed.

    Leon Mergen wrote: > "Radek Zajkowski" <infofinalbanana.com> schreef in bericht > news:php.general-130083news.php.net... > >>Is there, was there ever issue around including a lot files via >>include(). I am running things on a local server so it's hard to gauge. > > > I think that the only source that could cause any problems with too many > files included will be your operating system (since that thing has certain > limitations on a max number of locked files for example) . Other than that, > I don't think so. I myself include about 15 files on certain pages. But it > is easy to make a test or anything... > > Just make a PHP script that generates like 1000 php scripts called > "include.test.x.php" , where x is is a number, then the contents of those > scripts should by "<? include("include.test." . (x+1) . ".php");?>" or > something like that... > > Then you are for sure, and you immediately also know how much performance is > lost for including 1000 files :) > > >

    -- 
    I won't pay Bills'
    

    attached mail follows:


    "Stephan Seidt" <blizz0x03.net> schreef in bericht news:3E159310.60007020x03.net... > I guess that PHP will close file 1 before it opens > file 2 and so on.. For example : > > include 'foo'; > include 'bar'; > > When bar is being opened foo is already closed.

    Hmmm, i think the parser is built recursive, so at the moment it sees an "include 'foo';" , it will look in foo, parse that one, and after it has finished foo, it will continue with the main script...

    attached mail follows:


    He likely ment that his local server is simply fast enough that any speed defference is unnoticeable, but on a shared host this might make some difference. Use include/require as you are more comfortable with it.

    Rasmus Lerdorf wrote:

    >>Is there, was there ever issue around including a lot files via >>include(). I am running things on a local server so it's hard to gauge. >> >> > >I don't understand that comment. includes/requires are always (well >nearly anyway) local to the server regardless of where the request is >coming from. So if you have a test box and it is fast enough for you, >then go with it. > >-Rasmus > > >

    attached mail follows:


    well ok, if it's :

    main.php : include 'foo';

    foo : include 'bar';

    bar : include 'whatever';

    ...

    there will be lots of used file descriptors at once

    Leon Mergen wrote: > "Stephan Seidt" <blizz0x03.net> schreef in bericht > news:3E159310.60007020x03.net... > >>I guess that PHP will close file 1 before it opens >>file 2 and so on.. For example : >> >>include 'foo'; >>include 'bar'; >> >>When bar is being opened foo is already closed. > > > Hmmm, i think the parser is built recursive, so at the moment it sees an > "include 'foo';" , it will look in foo, parse that one, and after it has > finished foo, it will continue with the main script... > > >

    -- 
    I won't pay Bills'
    

    attached mail follows:


    Hi !

    I'm new to php and I have not found a solution for my problem (dumb me) ok.. here we go...

    I have a file.. it's content is: hello, ello, llo and so on and so on.... ok.. and now I want to know how many "hello" words are in that file..

    how can I arrange it ?:)

    Thanks Tauntz

    attached mail follows:


    Use file system functions to get the contents of the file in a string, then us substr_count() on that string.

    Filesystem: http://www.php.net/manual/en/ref.filesystem.php substr_count: http://www.php.net/manual/en/function.substr-count.php

    Regrads Khalid Al-kary

    >Hi ! > >I'm new to php and I have not found a solution for my problem (dumb me) >ok.. here we go... > >I have a file.. it's content is: hello, ello, llo and so on and so on.... >ok.. and now I want to know how many "hello" words are in that file.. > >how can I arrange it ?:) > > >Thanks >Tauntz > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php

    _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus

    attached mail follows:


    Thank you.. figured it out now.

    Tauntz

    Khalid El-Kary wrote:

    > Use file system functions to get the contents of the file in a string, > then us substr_count() on that string. > > Filesystem: http://www.php.net/manual/en/ref.filesystem.php > substr_count: http://www.php.net/manual/en/function.substr-count.php > > Regrads > Khalid Al-kary > >> Hi ! >> >> I'm new to php and I have not found a solution for my problem (dumb me) >> ok.. here we go... >> >> I have a file.. it's content is: hello, ello, llo and so on and so >> on.... >> ok.. and now I want to know how many "hello" words are in that file.. >> >> how can I arrange it ?:) >> >> >> Thanks >> Tauntz >> >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php > > > > _________________________________________________________________ > MSN 8 with e-mail virus protection service: 2 months FREE* > http://join.msn.com/?page=features/virus > >

    attached mail follows:


    |$sql = "INSERT into $table_name (f_name, l_name, username, password) Values ('$f_name', '$l_name', '$username', '$password')";|

    notice the single quotes

    Karl James wrote:

    >Hey guys, > >I cant figure out what’s wrong with this code. >Im sure its syntax can some one take a look at it and >Help me out > >What im trying to do is create a form for sign up. >So that the values will be added to the table in the databse.. > >For log in purposes. > >Thanks >Karl >Here is the code. > >HYPERLINK >"http://host.makethewebsecure.com/~admin12/do_adduser.phps"http://host.m >akethewebsecure.com/~admin12/do_adduser.phps > > > >--- >Outgoing mail is certified Virus Free. >Checked by AVG anti-virus system (http://www.grisoft.com). >Version: 6.0.434 / Virus Database: 243 - Release Date: 12/25/2002 > > > >

    attached mail follows:


    mail($to, $subject, $body, "From: $email"); how do I insert an attachment into this mail function, It would be submitted with file field and would be called attachment. Regards, David

    attached mail follows:


    Content-Type: text/plain; charset="iso-8859-1" From: Gerald Timothy Quimpo <gquimposni-inc.com> To: "Jeff Bluemel" <jeffdomintcom.com>, php-generallists.php.net Date: Fri, 3 Jan 2003 11:07:20 +0800 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200301031107.21058.gquimposni-inc.com> Subject: Re: [PHP] way to insert timer / pause?

    On Friday 03 January 2003 10:56 am, Jeff Bluemel wrote: > if there a command, or a way I can put say a 5 second, or a 10 second pause > which will make it so it will output x amount of html, and then continue? > or if I can pause it will it not display any of the html until the entire > script has ran?

    that depends on a few things. output buffering (manual or automatic) may block immediate output of text or HTML.

    tables get displayed when the whole table has been received by the browser. so you can't show parts of a table. tables within tables will get displayed only when the outermost table is complete.

    there may also be quirks in browsers, proxies or servers that affect this, but i don't know any details.

    tiger

    -- 
    Gerald Timothy Quimpo  tiger*quimpo*org gquimpo*sni-inc.com tiger*sni*ph
    Public Key: "gpg --keyserver pgp.mit.edu --recv-keys 672F4C78"
                       Veritas liberabit vos.
                       Doveryai no proveryai.
    

    attached mail follows:


    I'm not even sure how to classify this...

    Given:

    <INPUT NAME="action" TYPE="SUBMIT" VALUE='<?=$Enabled?>');">

    Where $Enabled is either a 0 or 1 as read from a database ( TINYINT(1) );

    And

    echo "action = ".$_POST[action]."<BR>"; if ($_POST[action] == "1" || $_POST[action] == "0") echo = "UPDATE Company SET Enabled = ".!(intval($_POST[action]))." WHERE CompanyID = $id";

    (skipping all the obvious bits -- no pun intended)

    I cannot figure out how to simply make the 0 and 1 invert or negate or toggle as it were.

    When I submit the form, my output is:

    action = 0 UPDATE Company SET Enabled = 1 WHERE CompanyID = 89

    action = 1 UPDATE Company SET Enabled = WHERE CompanyID = 17

    I've tried all kinds of combinations, but whenever the action is 1 to begin with, the 'inverted' version is always blank or -2 when I would expect it to be 0.

    If I use echo = "UPDATE Company SET Enabled = ".~(intval($_POST[action]))." WHERE CompanyID = $id";

    action = 1 UPDATE Company SET Enabled = -2 WHERE CompanyID = 17

    attached mail follows:


    inverting value: $action = ($value==='1' ? '0' : '1' );

    Daevid Vincent wrote:

    >I'm not even sure how to classify this... > >Given: > ><INPUT NAME="action" TYPE="SUBMIT" VALUE='<?=$Enabled?>');"> > >Where $Enabled is either a 0 or 1 as read from a database ( TINYINT(1) >); > >And > >echo "action = ".$_POST[action]."<BR>"; >if ($_POST[action] == "1" || $_POST[action] == "0") > echo = "UPDATE Company SET Enabled = ".!(intval($_POST[action]))." >WHERE CompanyID = $id"; > >(skipping all the obvious bits -- no pun intended) > >I cannot figure out how to simply make the 0 and 1 invert or negate or >toggle as it were. > >When I submit the form, my output is: > >action = 0 >UPDATE Company SET Enabled = 1 WHERE CompanyID = 89 > >action = 1 >UPDATE Company SET Enabled = WHERE CompanyID = 17 > >I've tried all kinds of combinations, but whenever the action is 1 to >begin with, the 'inverted' version is always blank or -2 when I would >expect it to be 0. > >If I use > echo = "UPDATE Company SET Enabled = ".~(intval($_POST[action]))." >WHERE CompanyID = $id"; > >action = 1 >UPDATE Company SET Enabled = -2 WHERE CompanyID = 17 > > > >

    attached mail follows:


    -----Original Message----- From: Daevid Vincent To: php-generallists.php.net

    echo "action = ".$_POST[action]."<BR>"; if ($_POST[action] == "1" || $_POST[action] == "0") echo = "UPDATE Company SET Enabled = ".!(intval($_POST[action]))." WHERE CompanyID = $id";

    I cannot figure out how to simply make the 0 and 1 invert or negate or toggle as it were. --------------------------

    echo = "UPDATE Company SET Enabled = ".(1-$_POST[action]) ...

    Cheers!

    Mike

    attached mail follows:


    Do you know any resource about php performance?

    I wonder that can I use php+apache+oracle for a web site serving to many clients ( such as 10.000 ) at the same time?

    Fatih Üstündağ Yöre Elektronik Yayımcılık A.Ş. 0 212 234 00 90

    attached mail follows:


    Performance related issues depend on too many factors infact, however, PHP is known to be fast in itself (as an apache module), oracle is also known to be fast just like MySQL, but still it depends on what your app will do with the database, and how would you manage both your database and application in order to get good performance, one of the most important sides, is your hardware, single server, multiple servers, dual processors or more? , and so on ... your connection?

    However PHP, Oracle, Apache, Linux (prefered) is a good group.

    Regrads, Khalid Al-kary

    >Do you know any resource about php performance? > >I wonder that can I use php+apache+oracle for a web site >serving to many clients ( such as 10.000 ) at the same time? > > >Fatih Üstündağ >Yöre Elektronik Yayımcılık A.Ş. >0 212 234 00 90 > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php

    _________________________________________________________________ STOP MORE SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail

    attached mail follows:


    Get in touch with Zend. I bet they have benchmarks with their optimizer engine. http://www.zend.com/

    Cheers, Mike

    *********** REPLY SEPARATOR ***********

    On 03/01/2003 at 3:56 PM Fatih Üstündağ wrote:

    >Do you know any resource about php performance? > >I wonder that can I use php+apache+oracle for a web site >serving to many clients ( such as 10.000 ) at the same time?

    attached mail follows:


    Hi- I'd like to parse the string returned by popen("uptime", "r");. The string that is returned is:

    9:47am up 37 days, 16:24, 1 user, load average: 0.09, 0.02, 0.00

    What I'd like is 5 strings...the first contains "37 days, 16:24", the second "1 user", the third "0.09", the fourth "0.02", and the fifth "0.00".

    Any easy way to do this? Thanks very much in advance! -Greg

    attached mail follows:


    Just use explode() and then dont use what you dont want.

    Mike

    *********** REPLY SEPARATOR ***********

    On 03/01/2003 at 9:49 AM Greg wrote:

    >Hi- >I'd like to parse the string returned by popen("uptime", "r");. The string >that is returned is: > >9:47am up 37 days, 16:24, 1 user, load average: 0.09, 0.02, 0.00 > >What I'd like is 5 strings...the first contains "37 days, 16:24", the >second >"1 user", the third "0.09", the fourth "0.02", and the fifth "0.00". > >Any easy way to do this? Thanks very much in advance! >-Greg > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    check explode() ;)

    http://www.php.net/manual/en/function.explode.php

    Regrads, Khalid Al-kary

    >Hi- >I'd like to parse the string returned by popen("uptime", "r");. The string >that is returned is: > >9:47am up 37 days, 16:24, 1 user, load average: 0.09, 0.02, 0.00 > >What I'd like is 5 strings...the first contains "37 days, 16:24", the >second >"1 user", the third "0.09", the fourth "0.02", and the fifth "0.00". > >Any easy way to do this? Thanks very much in advance! >-Greg > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php

    _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus

    attached mail follows:


    I am using the pcntl_ fork() from PHP. The problem with exec() is that i need the variables and socket-descriptors from the parent.

    Thomas 'Neo' Weber

    ---
    thomasyoungarts.org
    neogothic-chat.de
    

    ----- Original Message ----- From: "Michael J. Pawlowsky" <mikejpvideotron.ca> To: "PHP-List" <php-generallists.php.net> Sent: Thursday, January 02, 2003 7:42 PM Subject: Re: [PHP] signal handler to ignore kill of parent

    > > Actually let me try to be a bit more helpful... nut not much though :-) > > Did you write the code for the fork(); > > Can you modify it? Read the fork, exec and clone man pages. > This might help you a bit understand the behaviour. > > If so just call exec from the forked process... this will create a new process instead of a child one. > Then call exit() in your forked process. > > Mike > > > > > > > *********** REPLY SEPARATOR *********** > > On 02/01/2003 at 7:05 PM Thomas Weber wrote: > > >Hi, > > > >i need some way for child-processes to ignore the kill of their parent. Any > >idea? > > > >Thanks, > >Thomas 'Neo' Weber > >--- > >thomasyoungarts.org > >neogothic-chat.de > > > > > >-- > >PHP General Mailing List (http://www.php.net/) > >To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    I doubt that I can do this... but as someone once told me, "There's no such thing as a stupid question". I guess they were never on any mailing lists! :-)

    So here it goes....

    Is there anyway to load a module without having access to php.ini kind of like a ini_set("extension=mymodule.co"); that would load a new process with this module and pass the request on to it?

    Cheers, Mike

    attached mail follows:


    php.net/dl

    On Fri, 3 Jan 2003, Michael J. Pawlowsky wrote:

    > > > I doubt that I can do this... but as someone once told me, "There's no such thing as a stupid question". > I guess they were never on any mailing lists! :-) > > So here it goes.... > > Is there anyway to load a module without having access to php.ini > kind of like a ini_set("extension=mymodule.co"); that would load a new process with this module and pass the request on to it? > > > Cheers, > Mike > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    I am trying to parse through a directory and get the modification dates of the file.

    <?PHP $DirToCheck = "tempdata/"; if ($handle = opendir($DirToCheck)) { while (false !== ($file = readdir($handle))) { echo "&nbsp;&nbsp;$file - Last Modified: " . date("F d Y H:i:s.", filemtime($file)) . "<br>\n"; } closedir($handle); } ?>

    All the files are coming back with a date of December 31 1969 19:00:00. What am I doing wrong? The next step is I want to check if the file is older than 30 minutes and if so, I want to delete it. How would I go about that?

    attached mail follows:


    you must prepend $DirToCheck to $file:

    filemtime($DirToCheck . $file)

    Christopher J. Crane wrote:

    >I am trying to parse through a directory and get the modification dates of >the file. > ><?PHP >$DirToCheck = "tempdata/"; >if ($handle = opendir($DirToCheck)) { > while (false !== ($file = readdir($handle))) { > echo "&nbsp;&nbsp;$file - Last Modified: " . date("F d Y H:i:s.", >filemtime($file)) . "<br>\n"; > } > closedir($handle); > } >?> > >All the files are coming back with a date of December 31 1969 19:00:00. What >am I doing wrong? The next step is I want to check if the file is older than >30 minutes and if so, I want to delete it. How would I go about that? > > > > > >

    attached mail follows:


    Oh that would make sense. I was think ahead. I thought the file was loaded into an array and I was like "foreach" in the array. So simple, I didn't see it.

    Thank you!

    "Marek Kilimajer" <kilimajerwebglobe.sk> wrote in message news:3E15BAD1.1020104webglobe.sk... > you must prepend $DirToCheck to $file: > > filemtime($DirToCheck . $file) > > > > Christopher J. Crane wrote: > > >I am trying to parse through a directory and get the modification dates of > >the file. > > > ><?PHP > >$DirToCheck = "tempdata/"; > >if ($handle = opendir($DirToCheck)) { > > while (false !== ($file = readdir($handle))) { > > echo "&nbsp;&nbsp;$file - Last Modified: " . date("F d Y H:i:s.", > >filemtime($file)) . "<br>\n"; > > } > > closedir($handle); > > } > >?> > > > >All the files are coming back with a date of December 31 1969 19:00:00. What > >am I doing wrong? The next step is I want to check if the file is older than > >30 minutes and if so, I want to delete it. How would I go about that? > > > > > > > > > > > > >

    attached mail follows:


    Just wondering what people are using/recommend out there.. I'm going to be getting a merchant account and let people purchase services through my website on a secure server, all in PHP. What concerns me is this archived post I came across:

    http://marc.theaimsgroup.com/?l=php-general&m=102165623600464&w=2

    Reading that, it sounds like it's not possible to use Payment Pro, or possibly other systems, with PHP .. is this correct? Some of the other posts in the archive sounded like people were using it, so I'm not really sure what is possible at this point.

    Thanks, Chad

    attached mail follows:


    I use PayPal. Does not require a merchant account. PHP payment interface and interaction is easy to implement. Via HTML in your webpage, you pass to PayPal the URL of the PHP script to be executed when a payment is received.

    ----- Original Message ----- From: "Chad Day" <cdayatpco.com> To: "php general" <php-generallists.php.net> Sent: Friday, January 03, 2003 10:14 AM Subject: [PHP] Recommend payment processors?

    Just wondering what people are using/recommend out there.. I'm going to be getting a merchant account and let people purchase services through my website on a secure server, all in PHP. What concerns me is this archived post I came across:

    http://marc.theaimsgroup.com/?l=php-general&m=102165623600464&w=2

    Reading that, it sounds like it's not possible to use Payment Pro, or possibly other systems, with PHP .. is this correct? Some of the other posts in the archive sounded like people were using it, so I'm not really sure what is possible at this point.

    Thanks, Chad

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

    attached mail follows:


    Paypal is not an option for reasons I won't begin to get into. I'm sure someone is using something solid out there ..

    -----Original Message----- From: Rick Emery [mailto:remeryemeryloftus.com] Sent: Friday, January 03, 2003 11:36 AM To: php general Subject: Re: [PHP] Recommend payment processors?

    I use PayPal. Does not require a merchant account. PHP payment interface and interaction is easy to implement. Via HTML in your webpage, you pass to PayPal the URL of the PHP script to be executed when a payment is received.

    ----- Original Message ----- From: "Chad Day" <cdayatpco.com> To: "php general" <php-generallists.php.net> Sent: Friday, January 03, 2003 10:14 AM Subject: [PHP] Recommend payment processors?

    Just wondering what people are using/recommend out there.. I'm going to be getting a merchant account and let people purchase services through my website on a secure server, all in PHP. What concerns me is this archived post I came across:

    http://marc.theaimsgroup.com/?l=php-general&m=102165623600464&w=2

    Reading that, it sounds like it's not possible to use Payment Pro, or possibly other systems, with PHP .. is this correct? Some of the other posts in the archive sounded like people were using it, so I'm not really sure what is possible at this point.

    Thanks, Chad

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

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

    attached mail follows:


    Hi all,

    Here is my problem. I got a web application, who must build a PDF using datas from a MySQL table and a logo (JPEG format), and send the PDF generated by mail.

    I manage to build the PDF.

    Instead of sending it via mail, I tried to open it directly on my browser, IE 6.0. All is ok, I see my datas, and the logo.

    But when I send it via mail, all I got when I open it on Acrobat Reader is datas, but the logo isn't displayed. Instead , I got a grey bow, and an alert message telling me : "Image too big".

    Of course I tried to put an image 15px*15px, so, not that big ;) but it's the same.

    I really don't understand, and as the library I use is specifical, it's not really easy to find help or documentation. And to be honnest, my application is soon finished, and if I had to change of library, it would take me lot of time :(

    I would really appreciate any help :)

    Thanks a lot.

    Natacha

    attached mail follows:


    Jason, et al --

    ...and then Jason Wong said... % % On Friday 03 January 2003 11:50, Michael J. Pawlowsky wrote: % > I was wondering if anyone had a good BreadCrumb class. ... % % You have started a new thread by taking an existing posting and replying to % it while you changed the subject.

    I try not to harp on this, though I vehemently agree that it just shouldn't be done. The probblem is that those who typically do this (usually it's LookOut! users; this is the first time I've noticed Calypso as the X-Mailer: and I'm sure there are some others) can't even see the threading information and can't use it in their MUA, "threading" only by a Subject: line, and will probably never learn. Since I use mutt and have the thread-breaking and thread-joining patch installed, I just break the thread and move on.

    Absolutely classic, though, was Jim MacCormaic's identical attempt at a new thread in response to your message!

    HAND

    :-D

    -- 
    David T-G                      * There is too much animal courage in 
    (play) davidtgjustpickone.org * society and not sufficient moral courage.
    (work) davidtgworkjustpickone.org  -- Mary Baker Eddy, "Science and Health"
    http://justpickone.org/davidtg/      Shpx gur Pbzzhavpngvbaf Qrprapl Npg!
    

    -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (FreeBSD)

    iD8DBQE+FbvzGb7uCXufRwARAm0EAJ9IsRhg2D1D2xk2N5gzc3zLayo47wCg11Ew ZmA7rfs+edjguMFxzedlwos= =2h2E -----END PGP SIGNATURE-----

    attached mail follows:


    Unfortunately Calypso threads the messages by date etc. Not Mail IDs. It has a "Show references" command that creates threads but I don't keep these mails on my system for more than a day unless there's some really good info in it. So it had no effect for me.

    It's a great mailer if you have many e-mail accounts and many roles. I have 15 different accounts (for different clients, businesses etc.) and it manages multiple personalities very well.

    Decent filtering (besides threads) Templates Auto-Responder Bulk Mail Grouped Mail Sigs attached to accounts PGP support LDAP Support Multiple Window Layouts etc. And uses very little ressources to do so.

    It was freeware for a while because support was dropped for it... but it is now it the hands of Rose City Software http://www.rosecitysoftware.com/Calypso/

    Ok enough of a plug for Calypso.....

    I just wanted to say I added php as a quick nick in my address book so it won't happend again!

    :-)

    Cheers, Mike

    >I try not to harp on this, though I vehemently agree that it just >shouldn't be done. The probblem is that those who typically do this >(usually it's LookOut! users; this is the first time I've noticed Calypso >as the X-Mailer: and I'm sure there are some others) can't even see the >threading information and can't use it in their MUA, "threading" only by >a Subject: line, and will probably never learn. Since I use mutt and >have the thread-breaking and thread-joining patch installed, I just break >the thread and move on. > >Absolutely classic, though, was Jim MacCormaic's identical attempt at a >new thread in response to your message!

    attached mail follows:


    I am beginning a tidy-up of a very messy site i am now managing. I have started splitting repeated sections into single header and footer files, for inclusion via php. Unfortunately the javascript no longer works, i.e. rollovers etc.

    Can someone please help me on this? Is this a known problem?

    --
    Adam Wilson
    __________
    Webmaster
    123Doc Ltd
    www.123doc.com
    

    attached mail follows:


    You may want to try a JavaScript mailing list.

    Adam Wilson wrote: > I am beginning a tidy-up of a very messy site i am now managing. I have > started splitting repeated sections into single header and footer files, for > inclusion via php. Unfortunately the javascript no longer works, i.e. > rollovers etc. > > Can someone please help me on this? Is this a known problem? > > > -- > Adam Wilson > __________ > Webmaster > 123Doc Ltd > www.123doc.com > > >

    -- 
    By-Tor.com
    It's all about the Rush
    http://www.by-tor.com
    

    attached mail follows:


    I can't remember who wanted the bit manipulation stuff... But I was looking for something in my bookmarks when I saw this simple little class.

    I use bits to test for user permissions for specific function. as in if ((int)$user.permissions & (int)$permbit) {}

    I dont use that class but thought it could be helpful to you. It has a FlipBit.

    Mike

    ------------------------------------ Start Class ---------------------------------------------

    <?php

    /* Constants */ define( "BIT_0", 0 ); define( "BIT_1", 1 ); define( "BIT_2", 2 ); define( "BIT_3", 4 ); define( "BIT_4", 8 ); define( "BIT_5", 16 ); define( "BIT_6", 32 ); define( "BIT_7", 64 ); define( "BIT_8", 128 ); define( "BIT_9", 256 ); define( "BIT_10", 512 ); define( "BIT_11", 1024 ); define( "BIT_12", 2048 ); define( "BIT_13", 4096 ); define( "BIT_14", 8192 ); define( "BIT_15", 16384 ); define( "BIT_16", 32768 ); define( "BIT_17", 65536 ); define( "BIT_18", 131072 ); define( "BIT_19", 262144 ); define( "BIT_20", 524288 ); define( "BIT_21", 1048576 ); define( "BIT_22", 2097152 ); define( "BIT_23", 4194304 ); define( "BIT_24", 8388608 ); define( "BIT_25", 16777216 ); define( "BIT_26", 33554432 ); define( "BIT_27", 67108864 ); define( "BIT_28", 134217728 ); define( "BIT_29", 268435456 ); define( "BIT_30", 536870912 ); define( "BIT_31", 1073741824 );

    class CBitField { var $bitfield = 0; function CBitField () { $this -> bitfield = ($this -> bitfield | 0); } function QueryBit ($bit) { if (($this -> bitfield & $bit) > 0 ) return 1; else return 0; } function SetBit ($bit, $boolean) { if ($boolean == 1) $this -> bitfield |= $bit; else $this -> bitfield &= ~$bit; } function FlipBit ($bit) { $this -> bitfield ^= $bit; } }

    ?>

    ---------------------- End Class -----------------------------------------------------

    Example

    $bits = new CBitField; $bits -> SetBit (BIT_1, 1); $bits -> SetBit (BIT_2, 0); $bits -> SetBit (BIT_3, 0); $bits -> FlipBit (BIT_3); echo $bits -> QueryBit(BIT_1).","; echo $bits -> QueryBit(BIT_2).","; echo $bits -> QueryBit(BIT_3);

    attached mail follows:


    I searched MARC first, but none of the "answers" there seemed to work.

    Installing: RH 8 Apache 1.3.27 (--enable-module=so) PHP 4.2.3 (--with-apxs --enable-ftp --with-esoob --with-mcrypt --with-curl --with-openssl, etc.) Openssl 0.9.7 Mcrypt 2.5.3 (--disable-posix-threads) Curl 7.10.2 (--enable-ftp --enable-http --with-ssl)

    No errors during installation. Apache/PHP loads without error.

    phpinfo shows mcrypt and curl support, yet both error out on basic functions (mcrypt_module_open, curl_init)(PHP Fatal Error: call to undefined function...)

    mcrypt support enabled version >= 2.4.x Supported ciphers twofish rijndael-128 rijndael-192 rijndael-256 saferplus rc2 xtea serpent safer-sk64 safer-sk128 cast-256 loki97 gost threeway cast-128 blowfish des blowfish-compat tripledes enigma arcfour panama wake Supported modes ofb cfb nofb cbc ecb stream ncfb ctr

    mcrypt.algorithms_dir /usr/local/lib/libmcrypt mcrypt.modes_dir /usr/local/lib/libmcrypt

    CURL support enabled CURL Information libcurl/7.10.2 OpenSSL/0.9.6b zlib/1.1.4 Any help appreciated.

    mike

    ----------------------------------------------- This email sent using CDM Sports Webmail v3.1 [ http://webmail.cdmsports.com ]

    attached mail follows:


    I posted just before, i think i'll try again and re-word...

    I have split a page up into three sections, header, content and footer. Header and footer are included in content via PHP. Header contains Javascript functions. Content and header both call the javascript functions. When i look at the source generated it looks exactly like before it was split.

    BUT the javascript generates errors. Does anyone have any idea why this might happen?

    ANY help is much appreciated.

    --
    Adam Wilson
    __________
    Webmaster
    123Doc Ltd
    www.123doc.com
    

    attached mail follows:


    It's not because of the splitting up...

    Because the browser does not even know about that.

    Save both files to disk and do a "diff" on them. I bet there will be a few lines...

    Mike

    *********** REPLY SEPARATOR ***********

    On 03/01/2003 at 5:21 PM Adam Wilson wrote:

    >I posted just before, i think i'll try again and re-word... > >I have split a page up into three sections, header, content and footer. >Header and footer are included in content via PHP. Header contains >Javascript functions. Content and header both call the javascript >functions. >When i look at the source generated it looks exactly like before it was >split. > >BUT the javascript generates errors. Does anyone have any idea why this >might happen? > >ANY help is much appreciated. > >-- >Adam Wilson >__________ >Webmaster >123Doc Ltd >www.123doc.com > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    -----Original Message----- From: Adam Wilson To: php-generallists.php.net

    I have split a page up into three sections, header, content and footer. Header and footer are included in content via PHP. Header contains Javascript functions. Content and header both call the javascript functions. When i look at the source generated it looks exactly like before it was split.

    BUT the javascript generates errors. Does anyone have any idea why this might happen? --------------------------

    If you're absolutely sure the generated source is completely identical, then no I have no idea -- what you are doing is exactly how I generate the majority of my pages, and it works fine.

    You really need to relate the JavaScript errors back to the source as displayed by your browser, work out why that page as displayed generates that error (not always easy in itself!), and then work out why your script generates the erroneous output. I've been through this process a couple of times, and it can sometimes be quite painful...!

    If you've got a decent file comparator handy, it might be worth flinging your original static page and a "Save As" of the generated page at it, to see if it detects anything your human eye failed to!!

    Cheers!

    Mike

    attached mail follows:


    two problemes here, off-topic, and i didn't see the code to figure out the error

    but maybe you forgot to remove the "<html><head>..." parts from each include except the header?

    regards, Khalid Al-Kary

    >I posted just before, i think i'll try again and re-word... > >I have split a page up into three sections, header, content and footer. >Header and footer are included in content via PHP. Header contains >Javascript functions. Content and header both call the javascript >functions. >When i look at the source generated it looks exactly like before it was >split. > >BUT the javascript generates errors. Does anyone have any idea why this >might happen? > >ANY help is much appreciated. > >-- >Adam Wilson >__________ >Webmaster >123Doc Ltd >www.123doc.com > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php

    _________________________________________________________________ The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail

    attached mail follows:


    At 1/3/2003 05:21 PM, you wrote:

    >I have split a page up into three sections, header, content and footer. >Header and footer are included in content via PHP. Header contains >Javascript functions. Content and header both call the javascript functions. >When i look at the source generated it looks exactly like before it was >split. > >BUT the javascript generates errors. Does anyone have any idea why this >might happen?

    When you include these headers, are all the files that are accessing them in the same directory? Are your references in your javascripts absolute or relative? If they're relative, and you change directories, the code breaks.

    But again, I haven't seen the code so I can't say.

    --
    S. Keller
    UI Engineer
    The Health TV Channel, Inc.
    (a non - profit organization)
    3820 Lake Otis Pkwy.
    Anchorage, AK 99508
    907.770.6200 ext.220
    907.336.6205 (fax)
    Email: skellerhealthtvchannel.org
    Web: www.healthtvchannel.org
    

    attached mail follows:


    At 1/3/2003 12:25 AM, Lightfirst wrote:

    Can someone explain to me why the loop that counts to 99 appears before the 5 by 5 grid in the following php code?

    Yes.

    ## else { ## echo "<td align=\"center\" valign=\"middle\" width=\"15%\" height=\"77\" border=\"1\" bordercolor=\"#000000\">"; ## echo "<div align=\"center\"><font size=\"1\&