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: Sun Jul 21 2002 - 07:32:28 CDT

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

    php-general Digest 21 Jul 2002 12:32:28 -0000 Issue 1477

    Topics (messages 108683 through 108720):

    Re: finding if $key has value
            108683 by: Michael Hall
            108702 by: Richard Lynch

    Need your help again.. Sorry...
            108684 by: Wee Keat
            108685 by: John Holmes
            108687 by: Wee Keat
            108689 by: Justin French
            108690 by: Wee Keat
            108704 by: Richard Lynch

    Re: HELP!!!!!
            108686 by: Liam MacKenzie

    if $char == "any form of white space"
            108688 by: Justin French
            108705 by: Richard Lynch

    Re: getting variables from other functions
            108691 by: Jason Wong
            108692 by: Tim Luoma
            108707 by: CC Zona

    Search Engines and Sessions(Cross Posted to comp.lang.php)
            108693 by: JJ Harrison
            108706 by: Richard Lynch
            108711 by: JJ Harrison
            108715 by: JJ Harrison

    Re: CRLF Injection in mail()
            108694 by: Richard Lynch

    need help exec command
            108695 by: umesh

    Re: Problem with sessions.(Again Sorry :)
            108696 by: Richard Lynch

    Re: retrieve data from multidimensional array
            108697 by: Richard Lynch

    Re: problem with exec
            108698 by: Richard Lynch

    Re: sablotron compile
            108699 by: Richard Lynch

    Re: Setting process priority
            108700 by: Richard Lynch

    Re: Dynamic menu
            108701 by: Richard Lynch

    Re: HTML E-mails
            108703 by: Richard Lynch
            108719 by: Steve Vernon
            108720 by: Mark Gallagher

    Possible to turn trans_sid off for one page?
            108708 by: Miguel Cruz
            108709 by: Rasmus Lerdorf

    write some text over image
            108710 by: Alawi

    Smart ass form
            108712 by: César Aracena

    Re: cURL - https??
            108713 by: olinux

    To print in PHP
            108714 by: Benjamin Woen
            108717 by: Lee
            108718 by: Lee

    Redirect Question
            108716 by: JJ Harrison

    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:


    Try something like this instead (untested):

    while (list($k, $v) = each($data))
    {
      if (substr($k,0,1) == 'a')
      {
        if (!isset($v))
        {
            $sectionA_error = 1;
        }
        else
        {
            $sectionA_error = 0;
        }
      }
    }

    You could also try array_key_exists() instead of isset() ... both should
    do the job.

    Michael

    > here is what i try to accpmplish:
    > $key "name's" in an array are: a1, a2, a3, .... .
    > $value dependes weather it has been checked, selected or entered.
    >
    > while (list($k, $v) = each($data))
    > {
    > for ($i=0; $i<count($k); $i++) {
    > if (substr ($k[$i], 0, 1) == 'a') {
    > if ($k == !$v) { // <-- ????
    > $sectionA_error = 1;
    > } else {
    > $sectionA_error = 0;
    > }
    > }
    > }
    > }
    > if ($sectionA_error) {
    > echo "Nothing entered.\n<br>";
    > } else {
    > echo "at least one entry.\n<br>";
    > }
    >
    > what i'm trying to get is:
    > if there is a least one or doesn't matter how many values error = 0,
    > if there is no value than error =1.
    >
    > cheers,
    >
    > Peter
    >
    >
    >

    -- 
    --------------------------------
    n   i   n   t   i  .   c   o   m
    php-python-perl-mysql-postgresql
    --------------------------------
    Michael Hall     nintininti.com
    --------------------------------
    

    attached mail follows:


    >here is what i try to accpmplish: >$key "name's" in an array are: a1, a2, a3, .... . >$value dependes weather it has been checked, selected or entered.

    # First, assume they screwed up until they prove otherwise: $sectionA_error = 1;

    >while (list($k, $v) = each($data)) > { > for ($i=0; $i<count($k); $i++) {

    # Here, they prove that they did not screw up: > if (substr ($k[$i], 0, 1) == 'a') {

    # Just take this part out. #> if ($k == !$v) { // <-- ???? #> $sectionA_error = 1; #> } else {

    # Since they did not screw up, set the 'error' flag to 0: > $sectionA_error = 0; > } > } > } >}

    >if ($sectionA_error) { > echo "Nothing entered.\n<br>"; > } else { > echo "at least one entry.\n<br>"; > } > >what i'm trying to get is: >if there is a least one or doesn't matter how many values error = 0, >if there is no value than error =1.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    Hi all...

    Sorry for troubling you guys again... but I really do not know what else I could do.

    Can you please tell me why this code fputs($write, "$productlist"); isn't printing correctly?

    I have already connected to db. Just this particular one didn't work... dun understand..

    The Code:

    fputs($write, "Email: $email\n\nProduct Enquired:"); while (list($key,$prod_id) = each($cart)) { $cart[$key] = $prod_id; $result = mysql_query("SELECT * FROM products WHERE prod_id = '$prod_id' ORDER BY prod_brand ASC", $link_id);

    $query_data = mysql_fetch_array($result); $gst = 1.10;

    $rrp = 1.12;

    $price = $query_data["price_lq"] * $rrp * $gst; $productlist .= "\n\n".$query_data["prod_brand"]." ".$query_data["prod_desc"]." $".number_format($price, 2, '.', ''); fputs($write, "$productlist");

    }

    fputs($write, "\n\n-----------------------------");

    Please help... thanks soooo much again.

    Yours, Wee Keat Chin

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

    "Man is only truly great when he acts from his passions."

    attached mail follows:


    Are the other lines being written correctly? How does it "not work?"

    Are you sure there is anything in the $cart array?? If there isn't, the while loop won't be executed. Put in a check to just make sure that it's being executed.

    ---John Holmes...

    > -----Original Message----- > From: Wee Keat [mailto:weekeatamorphosium.com] > Sent: Saturday, July 20, 2002 9:25 PM > To: PHP General > Subject: [PHP] Need your help again.. Sorry... > > Hi all... > > Sorry for troubling you guys again... but I really do not know what else I > could do. > > Can you please tell me why this code fputs($write, "$productlist"); isn't > printing correctly? > > I have already connected to db. Just this particular one didn't work... > dun understand.. > > > The Code: > > > fputs($write, "Email: $email\n\nProduct Enquired:"); > > while (list($key,$prod_id) = each($cart)) { > > $cart[$key] = $prod_id; > > $result = mysql_query("SELECT * FROM products WHERE prod_id = > '$prod_id' ORDER BY prod_brand ASC", $link_id); > > $query_data = mysql_fetch_array($result); > > $gst = 1.10; > > $rrp = 1.12; > > $price = $query_data["price_lq"] * $rrp * $gst; > > $productlist .= "\n\n".$query_data["prod_brand"]." > ".$query_data["prod_desc"]." $".number_format($price, 2, '.', ''); > > fputs($write, "$productlist"); > > } > > fputs($write, "\n\n-----------------------------"); > > > > Please help... thanks soooo much again. > > > > Yours, > Wee Keat Chin > > --------------------------------------------------- > > "Man is only truly great when he acts from his passions."

    attached mail follows:


    Let me put it a little more detail here...

    I am trying to created an online ordering system where customers buy something and dump them in a cart and later, when they are happy, they will submit the order and 2 things will happen in one script:

    1. The script before the line that I have submitted contain almost the same script but it is put in the mail() function. This mail() worked well... it generated the email, and the product list was created by retrieving from the database.

    2. The second part of the script, which is the one I've shown you is the part where it fputs everything into a file (like a backup) just in case a customer calls up regarding an order and we didn't receive the email.

    So, 2 things are created and done simultaneously - an email generated and sent to me, and a log file created to store a copy of the order.

    Problem:

    The mail() script worked just fine, which shows that the $cart contained values. This is the result of the email:

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

    There is one Order on Oshima Website.

    Date: Sunday July 21, 2002

    Time: 12:14:42 pm

    From: John Doe

    Address: 1212 Flinders Street Melbourne VIC 3000

    Tel: 981781818

    Mobile:

    Fax: 819811818

    Email: johndoe.com

    Product Enquired:

    BTC BTC STANDARD PS/2 KEYBOARD $9.24

    BTC Multimedia Keyboard P/S2 (With Internet Functions) $15.40

    MICROSOFT Microsoft Wireless Value Pack - PS/2 (Single Unit-cond. app) $96.10

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

    And this is the result of the fput()

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

    Date: Sunday July 21, 2002

    Time: 12:14:42 pm

    From: John Doe

    Address: 1212 Flinders Street Melbourne VIC 3000

    Tel: 981781818

    Mobile:

    Fax: 819811818

    Email: johndoe.com

    Product Enquired:

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

    Why?? Hmm... I was trying to figure this out for 2 days already...

    Thanks a lot for your reply.. Thanks so so much.

    :)

    Yours, Wee Keat Chin

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

    "Man is only truly great when he acts from his passions."

    ----- Original Message ----- From: "John Holmes" <holmes072000charter.net> To: "'Wee Keat'" <weekeatamorphosium.com>; "'PHP General'" <php-generallists.php.net> Sent: Sunday, July 21, 2002 11:39 AM Subject: RE: [PHP] Need your help again.. Sorry...

    > Are the other lines being written correctly? How does it "not work?" > > Are you sure there is anything in the $cart array?? If there isn't, the > while loop won't be executed. Put in a check to just make sure that it's > being executed. > > ---John Holmes... > > > -----Original Message----- > > From: Wee Keat [mailto:weekeatamorphosium.com] > > Sent: Saturday, July 20, 2002 9:25 PM > > To: PHP General > > Subject: [PHP] Need your help again.. Sorry... > > > > Hi all... > > > > Sorry for troubling you guys again... but I really do not know what > else I > > could do. > > > > Can you please tell me why this code fputs($write, "$productlist"); > isn't > > printing correctly? > > > > I have already connected to db. Just this particular one didn't > work... > > dun understand.. > > > > > > The Code: > > > > > > fputs($write, "Email: $email\n\nProduct Enquired:"); > > > > while (list($key,$prod_id) = each($cart)) { > > > > $cart[$key] = $prod_id; > > > > $result = mysql_query("SELECT * FROM products WHERE prod_id > = > > '$prod_id' ORDER BY prod_brand ASC", $link_id); > > > > $query_data = mysql_fetch_array($result); > > > > $gst = 1.10; > > > > $rrp = 1.12; > > > > $price = $query_data["price_lq"] * $rrp * $gst; > > > > $productlist .= "\n\n".$query_data["prod_brand"]." > > ".$query_data["prod_desc"]." $".number_format($price, 2, '.', ''); > > > > fputs($write, "$productlist"); > > > > } > > > > fputs($write, "\n\n-----------------------------"); > > > > > > > > Please help... thanks soooo much again. > > > > > > > > Yours, > > Wee Keat Chin > > > > --------------------------------------------------- > > > > "Man is only truly great when he acts from his passions."

    attached mail follows:


    There's obviously something different that you're doing for the mail to the fputs.

    I don't why you'd run through the shopping cart items twice...

    instead, I'd build the message in little fragments:

    $msg =''; $msg .= "Name: {$name}\n\n"; $msg .= "Email: {$email}\n\n"; ...

    this would include you adding e4ach item from the shopping cart.

    then, when you send your mail:

    mail($to, $subject, $msg, $headers);

    then, use the SAME $msg to write to the backup file.

    If you can get it right for the email, then the file write shouldn't cause any problems.

    justin

    on 21/07/02 12:18 PM, Wee Keat (weekeatamorphosium.com) wrote:

    > Let me put it a little more detail here... > > I am trying to created an online ordering system where customers buy something > and dump them in a cart and later, when they are happy, they will submit the > order and 2 things will happen in one script: > > 1. The script before the line that I have submitted contain almost the same > script but it is put in the mail() function. This mail() worked well... it > generated the email, and the product list was created by retrieving from the > database. > > 2. The second part of the script, which is the one I've shown you is the part > where it fputs everything into a file (like a backup) just in case a customer > calls up regarding an order and we didn't receive the email. > > So, 2 things are created and done simultaneously - an email generated and sent > to me, and a log file created to store a copy of the order. > > Problem: > > The mail() script worked just fine, which shows that the $cart contained > values. This is the result of the email: > > ------------------------------------------------------------------------------ > ------------------ > > There is one Order on Oshima Website. > > Date: Sunday July 21, 2002 > > Time: 12:14:42 pm > > From: John Doe > > Address: > 1212 Flinders Street > Melbourne VIC 3000 > > Tel: 981781818 > > Mobile: > > Fax: 819811818 > > Email: johndoe.com > > Product Enquired: > > BTC BTC STANDARD PS/2 KEYBOARD $9.24 > > BTC Multimedia Keyboard P/S2 (With Internet Functions) $15.40 > > MICROSOFT Microsoft Wireless Value Pack - PS/2 (Single Unit-cond. app) $96.10 > > ------------------------------------------------------------------------------ > ------------------ > > And this is the result of the fput() > > ------------------------------------------------------------------------------ > ------------------ > > Date: Sunday July 21, 2002 > > Time: 12:14:42 pm > > From: John Doe > > Address: > 1212 Flinders Street > Melbourne VIC 3000 > > Tel: 981781818 > > Mobile: > > Fax: 819811818 > > Email: johndoe.com > > Product Enquired: > > ------------------------------------------------------------------------------ > ----------------------- > > Why?? Hmm... I was trying to figure this out for 2 days already... > > Thanks a lot for your reply.. Thanks so so much. > > :) > > > Yours, > Wee Keat Chin > > --------------------------------------------------- > > "Man is only truly great when he acts from his passions." > > > > > ----- Original Message ----- > From: "John Holmes" <holmes072000charter.net> > To: "'Wee Keat'" <weekeatamorphosium.com>; "'PHP General'" > <php-generallists.php.net> > Sent: Sunday, July 21, 2002 11:39 AM > Subject: RE: [PHP] Need your help again.. Sorry... > > >> Are the other lines being written correctly? How does it "not work?" >> >> Are you sure there is anything in the $cart array?? If there isn't, the >> while loop won't be executed. Put in a check to just make sure that it's >> being executed. >> >> ---John Holmes... >> >>> -----Original Message----- >>> From: Wee Keat [mailto:weekeatamorphosium.com] >>> Sent: Saturday, July 20, 2002 9:25 PM >>> To: PHP General >>> Subject: [PHP] Need your help again.. Sorry... >>> >>> Hi all... >>> >>> Sorry for troubling you guys again... but I really do not know what >> else I >>> could do. >>> >>> Can you please tell me why this code fputs($write, "$productlist"); >> isn't >>> printing correctly? >>> >>> I have already connected to db. Just this particular one didn't >> work... >>> dun understand.. >>> >>> >>> The Code: >>> >>> >>> fputs($write, "Email: $email\n\nProduct Enquired:"); >>> >>> while (list($key,$prod_id) = each($cart)) { >>> >>> $cart[$key] = $prod_id; >>> >>> $result = mysql_query("SELECT * FROM products WHERE prod_id >> = >>> '$prod_id' ORDER BY prod_brand ASC", $link_id); >>> >>> $query_data = mysql_fetch_array($result); >>> >>> $gst = 1.10; >>> >>> $rrp = 1.12; >>> >>> $price = $query_data["price_lq"] * $rrp * $gst; >>> >>> $productlist .= "\n\n".$query_data["prod_brand"]." >>> ".$query_data["prod_desc"]." $".number_format($price, 2, '.', ''); >>> >>> fputs($write, "$productlist"); >>> >>> } >>> >>> fputs($write, "\n\n-----------------------------"); >>> >>> >>> >>> Please help... thanks soooo much again. >>> >>> >>> >>> Yours, >>> Wee Keat Chin >>> >>> --------------------------------------------------- >>> >>> "Man is only truly great when he acts from his passions." >

    attached mail follows:


    Justin........ thanks.......... :)

    You're absolutely right.... I shouldn't have done what i doing...

    Sorry.... just started learning programming 4 weeks ago... there's lots of stuffs that I do not know...

    Thanks so much for your advice... and thank you so much to all who cared to help...

    Deeply appreciate your efforts.

    Yours, Wee Keat Chin

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

    "Man is only truly great when he acts from his passions."

    ----- Original Message ----- From: "Justin French" <justinindent.com.au> To: "Wee Keat" <weekeatamorphosium.com>; <holmes072000charter.net>; "'PHP General'" <php-generallists.php.net> Sent: Sunday, July 21, 2002 12:38 PM Subject: Re: [PHP] Need your help again.. Sorry...

    > There's obviously something different that you're doing for the mail to the > fputs. > > I don't why you'd run through the shopping cart items twice... > > instead, I'd build the message in little fragments: > > $msg =''; > $msg .= "Name: {$name}\n\n"; > $msg .= "Email: {$email}\n\n"; > ... > > this would include you adding e4ach item from the shopping cart. > > then, when you send your mail: > > mail($to, $subject, $msg, $headers); > > then, use the SAME $msg to write to the backup file. > > > If you can get it right for the email, then the file write shouldn't cause > any problems. > > > justin > > > on 21/07/02 12:18 PM, Wee Keat (weekeatamorphosium.com) wrote: > > > Let me put it a little more detail here... > > > > I am trying to created an online ordering system where customers buy something > > and dump them in a cart and later, when they are happy, they will submit the > > order and 2 things will happen in one script: > > > > 1. The script before the line that I have submitted contain almost the same > > script but it is put in the mail() function. This mail() worked well... it > > generated the email, and the product list was created by retrieving from the > > database. > > > > 2. The second part of the script, which is the one I've shown you is the part > > where it fputs everything into a file (like a backup) just in case a customer > > calls up regarding an order and we didn't receive the email. > > > > So, 2 things are created and done simultaneously - an email generated and sent > > to me, and a log file created to store a copy of the order. > > > > Problem: > > > > The mail() script worked just fine, which shows that the $cart contained > > values. This is the result of the email: > > > > --------------------------------------------------------------------------

    ----
    > > ------------------
    > >
    > > There is one Order on Oshima Website.
    > >
    > > Date: Sunday July 21, 2002
    > >
    > > Time: 12:14:42 pm
    > >
    > > From: John Doe
    > >
    > > Address:
    > > 1212 Flinders Street
    > > Melbourne VIC 3000
    > >
    > > Tel: 981781818
    > >
    > > Mobile:
    > >
    > > Fax: 819811818
    > >
    > > Email: johndoe.com
    > >
    > > Product Enquired:
    > >
    > > BTC BTC STANDARD PS/2 KEYBOARD $9.24
    > >
    > > BTC Multimedia Keyboard P/S2 (With Internet  Functions) $15.40
    > >
    > > MICROSOFT Microsoft Wireless Value Pack - PS/2 (Single  Unit-cond. app)
    $96.10
    > >
    >
    > --------------------------------------------------------------------------
    ----
    > > ------------------
    > >
    > > And this is the result of the fput()
    > >
    >
    > --------------------------------------------------------------------------
    ----
    > > ------------------
    > >
    > > Date: Sunday July 21, 2002
    > >
    > > Time: 12:14:42 pm
    > >
    > > From: John Doe
    > >
    > > Address:
    > > 1212 Flinders Street
    > > Melbourne VIC 3000
    > >
    > > Tel: 981781818
    > >
    > > Mobile:
    > >
    > > Fax: 819811818
    > >
    > > Email: johndoe.com
    > >
    > > Product Enquired:
    > >
    >
    > --------------------------------------------------------------------------
    ----
    > > -----------------------
    > >
    > > Why?? Hmm... I was trying to figure this out for 2 days already...
    > >
    > > Thanks a lot for your reply.. Thanks so so much.
    > >
    > > :)
    > >
    > >
    > > Yours,
    > > Wee Keat Chin
    > >
    > > ---------------------------------------------------
    > >
    > > "Man is only truly great when he acts from his passions."
    > >
    > >
    > >
    > >
    > > ----- Original Message -----
    > > From: "John Holmes" <holmes072000charter.net>
    > > To: "'Wee Keat'" <weekeatamorphosium.com>; "'PHP General'"
    > > <php-generallists.php.net>
    > > Sent: Sunday, July 21, 2002 11:39 AM
    > > Subject: RE: [PHP] Need your help again.. Sorry...
    > >
    > >
    > >> Are the other lines being written correctly? How does it "not work?"
    > >>
    > >> Are you sure there is anything in the $cart array?? If there isn't, the
    > >> while loop won't be executed. Put in a check to just make sure that
    it's
    > >> being executed.
    > >>
    > >> ---John Holmes...
    > >>
    > >>> -----Original Message-----
    > >>> From: Wee Keat [mailto:weekeatamorphosium.com]
    > >>> Sent: Saturday, July 20, 2002 9:25 PM
    > >>> To: PHP General
    > >>> Subject: [PHP] Need your help again.. Sorry...
    > >>>
    > >>> Hi all...
    > >>>
    > >>> Sorry for troubling you guys again... but I really do not know what
    > >> else I
    > >>> could do.
    > >>>
    > >>> Can you please tell me why this code fputs($write, "$productlist");
    > >> isn't
    > >>> printing correctly?
    > >>>
    > >>> I have already connected to db. Just this particular one didn't
    > >> work...
    > >>> dun understand..
    > >>>
    > >>>
    > >>> The Code:
    > >>>
    > >>>
    > >>> fputs($write, "Email: $email\n\nProduct Enquired:");
    > >>>
    > >>> while (list($key,$prod_id) = each($cart)) {
    > >>>
    > >>> $cart[$key] = $prod_id;
    > >>>
    > >>> $result = mysql_query("SELECT * FROM products WHERE prod_id
    > >> =
    > >>> '$prod_id' ORDER BY prod_brand ASC", $link_id);
    > >>>
    > >>> $query_data = mysql_fetch_array($result);
    > >>>
    > >>> $gst = 1.10;
    > >>>
    > >>> $rrp = 1.12;
    > >>>
    > >>> $price = $query_data["price_lq"] * $rrp * $gst;
    > >>>
    > >>> $productlist .= "\n\n".$query_data["prod_brand"]."
    > >>> ".$query_data["prod_desc"]." $".number_format($price, 2, '.', '');
    > >>>
    > >>> fputs($write, "$productlist");
    > >>>
    > >>> }
    > >>>
    > >>> fputs($write, "\n\n-----------------------------");
    > >>>
    > >>>
    > >>>
    > >>> Please help... thanks soooo much again.
    > >>>
    > >>>
    > >>>
    > >>> Yours,
    > >>> Wee Keat Chin
    > >>>
    > >>> ---------------------------------------------------
    > >>>
    > >>> "Man is only truly great when he acts from his passions."
    > >
    

    attached mail follows:


    >Can you please tell me why this code fputs($write, "$productlist"); isn't >printing correctly?

    What *IS* it printing? Blank lines? Nothing? Something?

    >I have already connected to db. Just this particular one didn't work... dun >understand.. > > >The Code: > > > fputs($write, "Email: $email\n\nProduct Enquired:"); > > while (list($key,$prod_id) = each($cart)) { > > $cart[$key] = $prod_id; > > $result = mysql_query("SELECT * FROM products WHERE prod_id = >'$prod_id' ORDER BY prod_brand ASC", $link_id);

    # Check Apache error_log for errors: if (!$result){ error_log(mysql_error()); }

    > $query_data = mysql_fetch_array($result); > > $gst = 1.10; > > $rrp = 1.12; > > $price = $query_data["price_lq"] * $rrp * $gst; > > $productlist .= "\n\n".$query_data["prod_brand"]." >".$query_data["prod_desc"]." $".number_format($price, 2, '.', '');

    At a minimum, you can't have that " $" in there and expect it to work... " \$" will do what you want.

    > > fputs($write, "$productlist");

    The quotes are kinda silly here. You're forcing PHP to create another string with the string $productlist in it, but it's already a string, and you're not adding anything new to it.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    Stealing other peoples work is bad. Offering to pay someone else to steal it for you is worse.

    Think about it, if they won't give you the script, they don't want you to have it do they? Using fopen() to get it: 1. Won't work 2. Is going to piss a lot of people off

    Write one for yourself, it's not hard. If in doubt about something and you can't find a solution in the Manual, come back here and ask a specific question.

    ----- Original Message ----- From: "Georgie Casey" <webmasterfilmfind.tv> To: <php-dblists.php.net>; <php-generallists.php.net> Sent: Sunday, July 21, 2002 6:44 AM Subject: [PHP] HELP!!!!!

    > check out this page: > http://www.clickatell.com/central/skins/converters/convert_bitmaps.php > > they wont give me a copy of this script. so i need to write my own. i would > just access the script from my servers, with fopen(), but i couldnt think of > a way to do this with a file upload.... > > willing to pay for a solution > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > >

    attached mail follows:


    Is this the best way to check if a $char is ANY FORM OF WHITESPACE (space, \t, \r, \n, etc etc)?

    if(preg_match('/\s/', $char)) { ... }

    ??

    Thanks Justin

    attached mail follows:


    >Is this the best way to check if a $char is ANY FORM OF WHITESPACE (space, >\t, \r, \n, etc etc)? > > >if(preg_match('/\s/', $char))

    Probably. But you're asking for a Holy Jihad between the POSIX Regex guys and the Perl Geeks to even ask the question :-)

    Oh, and technically, you need '/\\s/' since \ needs to be escaped even inside of '' for PHP.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    On Sunday 21 July 2002 06:20, Tim Luoma wrote: > I am just getting started with functions, and have checked the manual > and Core PHP Programming but I'm still missing something. > > > I have two functions in the same PHP file > > BTW "$SEARCHDATE" is in this format YYYYMMDD such as 20020720 for July > 20th, 2002 > > > function set_search_info ($SEARCHDATE) > { > global $SEARCHYEAR ; > global $SEARCHMONTH ; > global $SEARCHDAY ; > $SEARCHYEAR = substr("$SEARCHDATE", 0,4); > $SEARCHMONTH = substr("$SEARCHDATE", -4,-2); > $SEARCHDAY = substr("$SEARCHDATE", -2); > } > > > > function get_yesterday_info ($YESTERDAY) > { > > global $YESTERDAYHUMAN ; > global $YESTERDAYLINK ; > global $PREVIOUSCOMMENT ; > global $LINKBACK ; > > $YESTERDAYHUMAN = strftime("%B %d > %Y",mktime(0,0,0,$SEARCHMONTH,$SEARCHDAY-1,$SEARCHYEAR)); > > $YESTERDAYLINK = "&lt;&lt; <a > href=\"$SCRIPT?$YESTERDAY\">$YESTERDAYHUMAN</a>"; > > $PREVIOUSCOMMENT = Exec("/usr/bin/rdjpgcom images/$YESTERDAY.jpg"); > > $LINKBACK = "yes" ; > } > > > > But $YESTERDAYHUMAN keeps getting set to: November 29 1999 even though > $SEARCHYEAR and $SEARCHMONTH and $SEARCHDAY are set properly outside of > get_yesterday_info

    Did you print out $SEARCHMONTH & $SEARCHDAY to see what values they contained? This is a basic debugging technique that everyone should use.

    If you had did that you will see that they are both empty. Which means that you forgot to declare them as global.

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

    /* Are you sure the back door is locked? */

    attached mail follows:


    Jason Wong wrote:

    > Did you print out $SEARCHMONTH & $SEARCHDAY to see what values they contained? > This is a basic debugging technique that everyone should use.

    Ah.. yes I see what I did wrong... I had previously printed them out but it was within the function where they **were** defined as global (see my erroneous assumption below)...

    > If you had did that you will see that they are both empty. Which means that > you forgot to declare them as global.

    I had the mistaken notion that once a variable had been defined as 'global' in one function that it was then available for the rest of the PHP script.

    Thanks for the clue

    TjL

    attached mail follows:


    In article <3D3A3ABA.2030705peak.org>, luomatpeak.org (Tim Luoma) wrote:

    > > If you had did that you will see that they are both empty. Which means that > > you forgot to declare them as global. > > I had the mistaken notion that once a variable had been defined as > 'global' in one function that it was then available for the rest of the > PHP script.

    You've fallen into a common terminology trap: we talk about that keyword as "declaring a global" or "declaring as global", when that keyword's purpose would be better described as "declaring that when making reference to the following variable(s), I mean the one(s) in the global namespace rather than this function's local namespace." Use of the "global" keyword doesn't change a variable's namespace, so much as it calls out to the specified namespace.

    -- 
    CC
    

    attached mail follows:


    Hi,

    I am worried about search engines and sessions.

    If the UA doesn't support cookies the session id is passed through the urls.

    Search engines won't spider pages with a ? in the url because page.php?sid=bdf4f91bcc71443cd251a7d3eed05c9c and page.php?sid=5a547f86ea14186942d0305e352d9e41 would be considered different pages(The search engines robot could go into a continuos loop).

    I only use sessions on all pages but they do nothing if the user hasn't signed in.

    what would be a good way to not start the session id in the url if the person had not logged in anyway? The problem is that if you haven't started a session you can't check for session variables.

    Thanks,

    --
    JJ Harrison
    webmastertececo.com
    www.tececo.com
    

    attached mail follows:


    >I am worried about search engines and sessions. > >If the UA doesn't support cookies the session id is passed through the urls. > >Search engines won't spider pages with a ? in the url because >page.php?sid=bdf4f91bcc71443cd251a7d3eed05c9c and >page.php?sid=5a547f86ea14186942d0305e352d9e41 would be considered different >pages(The search engines robot could go into a continuos loop). > >I only use sessions on all pages but they do nothing if the user hasn't >signed in. > >what would be a good way to not start the session id in the url if the >person had not logged in anyway? The problem is that if you haven't started >a session you can't check for session variables.

    You have several options:

    1. Use robots.txt (Google for Robot Guidelines) to "force" the search engines to specific URLs you want indexed.

    2. Attempt to "detect" the major search engines, and give them a sessionless link. Not recommended. They may think you're trying to hide a porn site from them.

    3. "Hide" the ? from the search engines, by simply not using ? in your URL. Use / instead, and then your GET data won't be in $_GET, but it will be in $PATH_INFO and $REQUEST_URI (see <?php phpinfo();?>. It will also mess up $PHP_SELF, but it's a small price to pay. :-) php.php/sid/bdf4f91bcc71443cd251a7d3eed05c9c

    While these will be "different" pages to the search engines, you should be propagating the session ID for the entire search -- IE< the spider will get its own SID, and will keep re-presenting it in the links it continues to traverse. Although, if you time out your sessions faster than the spider travels, you'll lose them.

    There are probably more ways to skin this cat.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    I just had an idea.

    session_start(); // Start Sessions if(isset($_SESSION['fname']) != true){ session_destroy(); }

    It works until I login. Then I get this error(When cookies is on):

    Warning: Trying to destroy uninitialized session in C:\Inetpub\CO2 Busters MK2\includes\required.php on line 35

    Warning: Cannot send session cookie - headers already sent by (output started at C:\Inetpub\CO2 Busters MK2\includes\article.func.php:148) in C:\Inetpub\CO2 Busters MK2\includes\session.func.php on line 13

    Warning: Cannot send session cache limiter - headers already sent (output started at C:\Inetpub\CO2 Busters MK2\includes\article.func.php:148) in C:\Inetpub\CO2 Busters MK2\includes\session.func.php on line 13

    Or this error(When cookies are off):

    Warning: Cannot send session cookie - headers already sent by (output started at C:\Inetpub\CO2 Busters MK2\includes\article.func.php:148) in C:\Inetpub\CO2 Busters MK2\includes\session.func.php on line 22

    Warning: Constant sid already defined in C:\Inetpub\CO2 Busters MK2\includes\session.func.php on line 22

    Warning: Cannot send session cache limiter - headers already sent (output started at C:\Inetpub\CO2 Busters MK2\includes\article.func.php:148) in C:\Inetpub\CO2 Busters MK2\includes\session.func.php on line 22

    Here is the session.func.php file: <? function welcome_or_login(){ if(isset($_SESSION['fname'])){ echo 'Hello '.$_SESSION['fname'].'.'; } else { do_h('Login', 3, 'y'); do_hr(); login_form(''); } }

    function register_in_session($uid, $gid, $banid, $username, $fname, $lname, $email){ // Used in conjuction with validate() to input user info into the session session_register('uid'); session_register('gid'); session_register('banid'); session_register('username'); session_register('fname'); session_register('lname'); session_register('email'); } ?>

    when I do a var_dump($_SESSION) on the logon page(after logging in) I get array(0) { } when I do the same thing on any other page I get this: array(7) { ["uid"]=> &string(1) "1" ["gid"]=> &string(1) "1" ["banid"]=> &string(1) "0" ["username"]=> &string(6) "Lizner" ["fname"]=> &string(2) "JJ" ["lname"]=> &string(8) "Harrison" ["email"]=> &string(24) "webmasterco2busters.org" }

    How can I fix it? or isn't it possible?

    --
    JJ Harrison
    webmastertececo.com
    www.tececo.com
    

    Once I leave the login page the sessions work fine(I did a var dump

    "Richard Lynch" <richphpbootcamp.com> wrote in message news:php.general-108706news.php.net... > >I am worried about search engines and sessions. > > > >If the UA doesn't support cookies the session id is passed through the urls. > > > >Search engines won't spider pages with a ? in the url because > >page.php?sid=bdf4f91bcc71443cd251a7d3eed05c9c and > >page.php?sid=5a547f86ea14186942d0305e352d9e41 would be considered different > >pages(The search engines robot could go into a continuos loop). > > > >I only use sessions on all pages but they do nothing if the user hasn't > >signed in. > > > >what would be a good way to not start the session id in the url if the > >person had not logged in anyway? The problem is that if you haven't started > >a session you can't check for session variables. > > You have several options: > > 1. Use robots.txt (Google for Robot Guidelines) to "force" the search > engines to specific URLs you want indexed. > > 2. Attempt to "detect" the major search engines, and give them a sessionless > link. Not recommended. They may think you're trying to hide a porn site > from them. > > 3. "Hide" the ? from the search engines, by simply not using ? in your URL. > Use / instead, and then your GET data won't be in $_GET, but it will be in > $PATH_INFO and $REQUEST_URI (see <?php phpinfo();?>. It will also mess up > $PHP_SELF, but it's a small price to pay. :-) > php.php/sid/bdf4f91bcc71443cd251a7d3eed05c9c > > While these will be "different" pages to the search engines, you should be > propagating the session ID for the entire search -- IE< the spider will get > its own SID, and will keep re-presenting it in the links it continues to > traverse. Although, if you time out your sessions faster than the spider > travels, you'll lose them. > > There are probably more ways to skin this cat. > > -- > Like Music? http://l-i-e.com/artists.htm >

    attached mail follows:


    That eventually worked I just had something wrong(called session_start(); twice) "Jj Harrison" <webmastertececo.com> wrote in message news:20020721072912.62446.qmailpb1.pair.com... > I just had an idea. > > session_start(); > // Start Sessions > if(isset($_SESSION['fname']) != true){ > session_destroy(); > } > > It works until I login. Then I get this error(When cookies is on): > > Warning: Trying to destroy uninitialized session in C:\Inetpub\CO2 Busters > MK2\includes\required.php on line 35 > > Warning: Cannot send session cookie - headers already sent by (output > started at C:\Inetpub\CO2 Busters MK2\includes\article.func.php:148) in > C:\Inetpub\CO2 Busters MK2\includes\session.func.php on line 13 > > Warning: Cannot send session cache limiter - headers already sent (output > started at C:\Inetpub\CO2 Busters MK2\includes\article.func.php:148) in > C:\Inetpub\CO2 Busters MK2\includes\session.func.php on line 13 > > > Or this error(When cookies are off): > > > Warning: Cannot send session cookie - headers already sent by (output > started at C:\Inetpub\CO2 Busters MK2\includes\article.func.php:148) in > C:\Inetpub\CO2 Busters MK2\includes\session.func.php on line 22 > > Warning: Constant sid already defined in C:\Inetpub\CO2 Busters > MK2\includes\session.func.php on line 22 > > Warning: Cannot send session cache limiter - headers already sent (output > started at C:\Inetpub\CO2 Busters MK2\includes\article.func.php:148) in > C:\Inetpub\CO2 Busters MK2\includes\session.func.php on line 22 > > Here is the session.func.php file: > <? > function welcome_or_login(){ > if(isset($_SESSION['fname'])){ > echo 'Hello '.$_SESSION['fname'].'.'; > } else { > do_h('Login', 3, 'y'); > do_hr(); > login_form(''); > } > } > > function register_in_session($uid, $gid, $banid, $username, $fname, $lname, > $email){ > // Used in conjuction with validate() to input user info into the session > session_register('uid'); > session_register('gid'); > session_register('banid'); > session_register('username'); > session_register('fname'); > session_register('lname'); > session_register('email'); > } > ?> > > when I do a var_dump($_SESSION) on the logon page(after logging in) I get > array(0) { } > when I do the same thing on any other page I get this: > array(7) { ["uid"]=> &string(1) "1" ["gid"]=> &string(1) "1" ["banid"]=> > &string(1) "0" ["username"]=> &string(6) "Lizner" ["fname"]=> &string(2) > "JJ" ["lname"]=> &string(8) "Harrison" ["email"]=> &string(24) > "webmasterco2busters.org" } > > How can I fix it? or isn't it possible? > > > -- > JJ Harrison > webmastertececo.com > www.tececo.com > > Once I leave the login page the sessions work fine(I did a var dump > > "Richard Lynch" <richphpbootcamp.com> wrote in message > news:php.general-108706news.php.net... > > >I am worried about search engines and sessions. > > > > > >If the UA doesn't support cookies the session id is passed through the > urls. > > > > > >Search engines won't spider pages with a ? in the url because > > >page.php?sid=bdf4f91bcc71443cd251a7d3eed05c9c and > > >page.php?sid=5a547f86ea14186942d0305e352d9e41 would be considered > different > > >pages(The search engines robot could go into a continuos loop). > > > > > >I only use sessions on all pages but they do nothing if the user hasn't > > >signed in. > > > > > >what would be a good way to not start the session id in the url if the > > >person had not logged in anyway? The problem is that if you haven't > started > > >a session you can't check for session variables. > > > > You have several options: > > > > 1. Use robots.txt (Google for Robot Guidelines) to "force" the search > > engines to specific URLs you want indexed. > > > > 2. Attempt to "detect" the major search engines, and give them a > sessionless > > link. Not recommended. They may think you're trying to hide a porn site > > from them. > > > > 3. "Hide" the ? from the search engines, by simply not using ? in your > URL. > > Use / instead, and then your GET data won't be in $_GET, but it will be in > > $PATH_INFO and $REQUEST_URI (see <?php phpinfo();?>. It will also mess up > > $PHP_SELF, but it's a small price to pay. :-) > > php.php/sid/bdf4f91bcc71443cd251a7d3eed05c9c > > > > While these will be "different" pages to the search engines, you should be > > propagating the session ID for the entire search -- IE< the spider will > get > > its own SID, and will keep re-presenting it in the links it continues to > > traverse. Although, if you time out your sessions faster than the spider > > travels, you'll lose them. > > > > There are probably more ways to skin this cat. > > > > -- > > Like Music? http://l-i-e.com/artists.htm > > > >

    attached mail follows:


    >> NO! They'll get a Bcc: on the *ONE* email they sent with your FORM. > >It depends on your form. If you have a "contact the admins" form, then >they can find out your email. Or say you are running an AA help group

    They can already find out my email[s] from harvesting it here :-^

    >and you provide a way for people to email each other through the web. >Someone can type in a message and then your PHP script send out a >message to each of the members, but the message is from your web site, >not the person, so their identities are hidden, for privacy reasons. Now >if I put in a contaminated Subject, I can get CC:d on EVERY email that >the script sends out at that time. I can find out everyone's email >address. How are you protecting the privacy of your users?

    I use Bcc: on all of them, of course. How else would you do it?

    >> Since they *SENT* the email, that does not seem like much of an issue >to >> me. > >It's not the content they would be after, it would be finding out the >email addresses of the recipients.

    The only email they get is mine, which, like, already gets so much spam it just doesn't matter any more. Sigh.

    >This is something that 99% of the people out there aren't going to think >about. Look at all the problems already with cross-site scripting. It's >an easy fix, yes, once you know about it, but I think it could be better >handled at the PHP core level. > >Is there ever a need to let someone set additional headers in the >Subject part of mail()? Why allow people the change to do it and have >unwanted consequences when it's easily fixed for everyone?

    Apply for a CVS account and fix it, then. :-)

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    Hi Gurus,

    I am using PHP 4.1.1, Postgresql 7.2 and Perl 5.6.0 on Linux.

    I want to execute a perl script throgh a PHP, which will take backup of the database after submit button on the PHP is clicked.

    I am using exec command, but as PHP runs as "nobody" user, it does not have access to Postgres database. So it creates a file of 0 byte.

    Can anybody tell me how to change user for execution of a particular PHP, or is there any other alternative.

    Thanking you in anticipation.

    Regards

    Umesh. ***************************** Umesh A. Deshmukh. Manas Solutions Pvt. Ltd. umeshmanas-solutions.com http://www.manas-solutions.com Ph. : 91+020+4006358,4223991/92 *****************************

    attached mail follows:


    >I have a login script which calls this function if it is a proper user etc. > >function register_in_session($uinfo){ >// Used in conjuction with validate to input user info into the session > $_SESSION['uid'] = $uinfo[0]; > $_SESSION['gid'] = $uinfo[1]; > $_SESSION['banid'] = $uinfo[2]; > $_SESSION['username'] = $uinfo[3]; > $_SESSION['fname'] = $uinfo[4]; > $_SESSION['lname'] = $uinfo[5]; > $_SESSION['email'] = $uinfo[6]; >}

    Don't cram things into $_SESSION. Use this:

    session_register('uid'); global $uid; $uid = $uinfo[0];

    >as a test i use this function in all my pages. > >function welcome_or_login(){ >if(isset($_SESSION['fname'])){ > echo 'Hello '.$_SESSION['fname'].'.'; > } else { > do_h('Login', 3, 'y'); > do_hr(); > login_form(''); > } >} > >Only on the login page my test user's name is displayed. On all other pages >it reverts to the login form.

    You didn't register them -- You just crammed some arbitrary junk into $_SESSION. The variable $uid didn't have any value in it.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    > >I have a multidimensional array. How can I search and retrieve all data >that is like $value from it. >the array looks like this $multi=array($row_0,$row_1); I want to >retrieve all data where $value matches $row_1 and display the data on >the screen. I know that array_search and in_array will tell me that >the data exist but I what to retrieve it.

    It's hard to tell from what you've said, but you might be able to use http://php.net/array_flip

    <?php $flipped = array_fliep($multi); echo $flipped[$value]; ?>

    I'm not quite sure, though, what you have in $value, $row_0, or $row_1, or what you consider a "match" nor what data you want to display on the screen...

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    > exec("perl /usr/local/apache/htdocs/mlm/test/check1.pl &");

    exec("..., $results, $errorcode); echo implode("<BR>\n", $results); if ($errorcode){ echo "OS Error $errorcode. Usually path/permissions. Use 'man erno' to be sure"); }

    >_____________________________ > >#!/usr/bin/perl - > >use POSIX qw(strftime); >$Date=POSIX::strftime("%Y%m%d%H%M", localtime); >system("pg_dump -S postgres -f testUDdb >>/usr/local/apache/htdocs/mlm/admin/backup/".$Date."backup");

    The other poster is quite correct that it's kinda silly to fire up a shell to fire up perl to fire up pg_dump.

    You can at least cut out the Perl part. :-)

    And, actually, you should probably be doing this as part of a cron job rather than relying on frail humans to remember to click the button once in awhile :-)

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    >I went for a swiss army knife build of PHP with pdflib, xml and >xslt (sablotron). Everything went fine until make install, which exited >with: > >make[1]: *** [libphp4.1a] Error 1 > >and > >make: *** [install-recursive] Error 1

    Like, the lines before these lines are the lines that tell us what broke...

    Or at least point us in the right direction...

    >Everything works fine until I try to add Sablotron. >Sablotron compiled and installed OK.

    I dunno nothing 'bout Sablotron, really, but you can search the archives for the same error message (the ones you didn't post)

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    >I'm using php to generate a dynamic pdf document and when ready send it with >email. >Since it takes few minutes to generate I start a new process with popen that >makes the pdf like this > > popen("./pdf.php \"".$outputarray."\" > /dev/null &", "r"); > >pdf.php then generates it and everything is ok but this new process takes so >much cpu that the site is halted for these few minutes. >My question... is there a way to set pdf.php-process to a lower priority? >I've searched everywere and couldn't find it. > >Please reply in email since I will miss it otherwise

    Are you 100% sure the whole server is being slammed by this?...

    Or is it just the page you are viewing is waiting for the popen to finish, depsite your & in the command?...

    I dunno if popen returns the process id number or not, but I *THINK* you can reduce the priority with another exec() if it does...

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    >Hi all. I’m making a few dynamic menus that grab information from a >MySQL DB. What I don’t know is how to print only one line of each. I >don’t want a Drop Down List displaying 4 times the same line if the >information is repeated in 4 rows in the same table. What I’m using is >something like: > >$query = “SELECT * FROM tbl_name”; >$result = mysql_quiery($query) or die(mysql_error()); >$num_rows = mysql_num_rows($result); > > ><select name="select_name"> ><option SELECTED>Select Something</option> > >for ($i=0; $i<$num_rows: $i++) >{ >$row = mysql_fetch_array($result); >print ("<option value=\"".$row[some]."\">".$row[some_else]."</option>"); >} > ></select> > >This works just fine now that I don’t have 2 or more rows with the >“some_else” repeated. Is there a WHERE or something like that which I >can use for this?

    I think you want SELECT DISTINCT * http://mysql.com/

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    >Hello all, > >I've just set out to build a PHP-based mail system that will be able to send >HTML e-mails to a variety of mail clients. So far, I'm having moderate >success: I can get Yahoo! and Hotmail to see the HTML, but not Netscape Mail >or Outlook Express. > >I was wondering, is there anything special I should be putting in my mail() >call to achieve broad compatibility? I'm already sending a header that >includes: > >MIME-Version: 1.0\r\n >Content-type: text/html; charset=iso-8859-1\r\n > >Also, does anyone know of a list of mail client compatiblity levels with >HTML e-mail?

    Read the source to (or just *USE*) the Mail Class at:

    http://phpclasses.org

    PS HTML E-mails suck. :-) PPS More seriously, expect a lot of people to hit delete, just because it *IS* HTML E-mail.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    Richard, Look I am one of those people who hate Microsoft etc, and Linux is far better.

    But what is wrong with HTML email? Why not have some colour and style in an email. It's like a letter, and u can have nice paper. If it is about Linux programs, some can read HTML email.

    If we cant have some colour and style, then computers will end up being only for Gurus. Say Windows XP, ok perhaps there are bugs but the GUI is sooo nice, so intuitive that my 80 year old grandma is learning to use it.

    Just think it's rude that people would just delete an email because of using HTML will most mail programs send by default these days!

    Steve

    |-----Original Message----- |From: Richard Lynch [mailto:richphpbootcamp.com] |Sent: 21 July 2002 06:24 |To: php-generallists.php.net |Subject: [PHP] Re: HTML E-mails | | |>Hello all, |> |>I've just set out to build a PHP-based mail system that will |be able to |>send |>HTML e-mails to a variety of mail clients. So far, I'm having |moderate |>success: I can get Yahoo! and Hotmail to see the HTML, but |not Netscape Mail |>or Outlook Express. |> |>I was wondering, is there anything special I should be putting in my |>mail() |>call to achieve broad compatibility? I'm already sending a |header that |>includes: |> |>MIME-Version: 1.0\r\n |>Content-type: text/html; charset=iso-8859-1\r\n |> |>Also, does anyone know of a list of mail client compatiblity levels |>with |>HTML e-mail? | |Read the source to (or just *USE*) the Mail Class at: | |http://phpclasses.org | |PS HTML E-mails suck. :-) |PPS More seriously, expect a lot of people to hit delete, |just because it |*IS* HTML E-mail. | |-- |Like Music? http://l-i-e.com/artists.htm | | |-- |PHP General Mailing List (http://www.php.net/) |To unsubscribe, visit: http://www.php.net/unsub.php |

    attached mail follows:


    Steve Vernon wrote: > Look I am one of those people who hate Microsoft etc, and Linux > is far better.

    Me too, actually, but that's not what's at issue here.

    > But what is wrong with HTML email? Why not have some colour and > style in an email. It's like a letter, and u can have nice paper. If it > is about Linux programs, some can read HTML email.

    HTML email increases filesize horribly. I once received an email consisting entirely of a couple of lines of text that would have taken maybe 2k of space. Because the luser who sent it used HTML, it was 13k in size. Maybe an extra 11k isn't that much, but at the time I was using Telstra Bigpond as my ISP... believe me, every kbyte matters.

    It also doesn't add anything. Pretty colours and flashing lights make it harder to read email, and even if you just restrict yourself to basic document formatting, well, is it *that* important that your text is shown as <strong>strong emphasis</strong> rather than *strong emphasis*?

    It can also confuse things for users of older mail clients, or who turn HTML email off. Consider those with Mutt, Mozilla-with-HTML-disabled, Eudora, Pegasus... if your HTML is automatically stripped, we don't get your nice formatting (we don't care :-), but sometimes if the person's particularly clueless, their email will be full of references to the pretty design they've concocted, which makes it utterly useless to us), and if it isn't, then we have to decipher the HTML first.

    I love HTML, and one day I hope my high (some might say anal) knowledge of the language will earn me a lot of money. But it doesn't belong in email.

    > If we cant have some colour and style, then computers will end > up being only for Gurus. Say Windows XP, ok perhaps there are bugs but

    I find it hard to believe that J. Random Clueneeder is so retarded that they can't enjoy email without pretty colours. I mean, /really/! Most people, once they get used to plain text (or forced to subsist on some of the worst ISPs in Australia), can handle it pretty well, even if it means their headings are 36 pixels tall.

    > the GUI is sooo nice, so intuitive that my 80 year old grandma is > learning to use it.

    A few bugs, a few glaring security holes, a few hurdles to installation that treats customers like thieves...

    > Just think it's rude that people would just delete an email > because of using HTML will most mail programs send by default these > days!

    So most email programs suck. Consider that Outlook and OE are the two single most popular mail clients in existance. Then, once you've stretched out from the foetal position and stopped weeping uncontrollably, try to educate people about HTML mail :-).

    -- 
    Mark Gallagher
    http://cyberfuddle.com/infinitebabble/
    

    attached mail follows:


    Maybe I'm doing something stupid here, but I can't seem to get trans_sid deactivated for a single page (it's turned on globally).

    I am calling:

    ini_set('session.use_trans_sid', 0);

    as the very first line, but all the links are still getting ?PHPSESSID=xxxx appended.

    Has anyone else come across this (and hopefully solved it)?

    miguel

    attached mail follows:


    By the time you get to ini_set() it is too late. Set this via an httpd.conf <Location> directive.

    -Rasmus

    On Sun, 21 Jul 2002, Miguel Cruz wrote:

    > Maybe I'm doing something stupid here, but I can't seem to get trans_sid > deactivated for a single page (it's turned on globally). > > I am calling: > > ini_set('session.use_trans_sid', 0); > > as the very first line, but all the links are still getting > ?PHPSESSID=xxxx appended. > > Has anyone else come across this (and hopefully solved it)? > > miguel > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    Hi how can I write some text on the left corner of the image?

    attached mail follows:


    Hi all. I have this form with some dynamically made fields. One of them fields is truly making me nuts. The thing is, I have a table in which I store the user id, the development language he/she uses and the time he/she has been using it. Something like this: +--------+--------+------------------+-------------------------+ | expid | devid | devlanguage | devtime | +--------+--------+------------------+-------------------------+ | 1 | 1 | PHP | less than 1 year | | 2 | 1 | MySQL | less than 1 year | | 3 | 1 | HTML | more than 5 years | +--------+------+--------------------+-------------------------+ Now, in the HTML form I want to display each language along with a checkbox for selection and a dropdown with a list of time periods. Some tough me in this list about naming the form fields like “language[]” in order to create an array and use it when it was not empty. Fine, the thing is that I also want to display a list of some 3 blank textboxes along with time periods drop downs so anyone who knows another language can add it to the list... the questions are as follows: 1) What would be the best approach to do this and how should I call all the checkboxes, textfields and drop downs? 2) How can I manage them after the form was submitted? Thanks in advance, <mailto:webmastericaam.com.ar> Cesar Aracena CE / MCSE+I Neuquen, Argentina +54.299.6356688 +54.299.4466621

    attached mail follows:


    This may be helpful as well.

    http://www.zend.com/codex.php?ida9&single\1

    olinux

    --- Jaime Bozza <jbozzathinkburst.com> wrote: > These may (or may not) help both of you. > > http://www.unknowndesigns.com/phpauthnet/home.php > > > Jaime Bozza > > > -----Original Message----- > From: David Buerer [mailto:davidpladesigns.com] > Sent: Friday, July 19, 2002 9:33 AM > To: 'php-generallists.php.net' > Subject: RE: [PHP] cURL - https?? > > > Yes..and no. It depends on how you connect to > Authorize Net. The best > way > is to use the direct response method which requires > a secure connection > to > their [authorize net's] servers. Curl is the only > way that I know how > to do > this with PHP. It's a bit slow (at least on NT,) but > it does get the job > done. I've got scheduled to finish my functions > which connect to AN's > servers and process transactions next week, I'll > make them available to > you > if you'd like. > > David Buerer > Senior Designer > PLA Designs, Inc. > > > -----Original Message----- > From: Daniel Guerrier > [mailto:dan_guerrieryahoo.com] > Sent: Friday, July 19, 2002 7:43 AM > To: php user group > Subject: [PHP] cURL - https?? > > Is cURL still needed to make secure connection > and/or > connect to a credit card authorizer. > > i.e authorize.net > > __________________________________________________ > Do You Yahoo!? > Yahoo! Autos - Get free new car price quotes > http://autos.yahoo.com > > -- > 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 >

    __________________________________________________ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com

    attached mail follows:


    Dear all,

    I am using PHP+MySQL to develop a database app, I want to include printing feature in this application that able to print to a standard format instead of using print function from the browser, anybody in this list that ever do something like this ? Appreciate if you can share with me the trick

    Thanks and best regards

    Ben Woen

    attached mail follows:


    There are a couple of ways I can think of doing this, depending on what platform you are designing for.

    One way would be to send the data you want printed to the browser formatted as RTF. This means than someone using either MS Word or something like StarOffice could simply safe the file and print it as normal.

    There is an article on phpbuilder about doing this, take a peak at http://www.phpbuilder.com/columns/nair20020523.php3

    Alternatively you could try using PDFlib or similair library, which would allow them to be opened in all platforms that support Adobe Acrobat. Not looked into this one much though.

    Hope this helps.

    Cheers

    Lee

    ----- Original Message ----- From: "Benjamin Woen" <benwoenindosat.net.id> To: <php-generallists.php.net> Sent: Sunday, July 21, 2002 10:26 AM Subject: [PHP] To print in PHP

    > Dear all, > > I am using PHP+MySQL to develop a database app, I want to include > printing feature in this application that able to print > to a standard format instead of using print function from the browser, > anybody in this list that ever do something like this ? > Appreciate if you can share with me the trick > > Thanks and best regards > > Ben Woen > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > >

    attached mail follows:


    Sorry just found an article on using PDF, have a look at: http://www.phpbuilder.com/columns/perugini20001026.php3

    ----- Original Message ----- From: "Lee" <leeunassemble.co.uk> To: "Benjamin Woen" <benwoenindosat.net.id>; <php-generallists.php.net> Sent: Sunday, July 21, 2002 10:55 AM Subject: Re: [PHP] To print in PHP

    > There are a couple of ways I can think of doing this, depending on what > platform you are designing for. > > One way would be to send the data you want printed to the browser formatted > as RTF. This means than someone using either MS Word or something like > StarOffice could simply safe the file and print it as normal. > > There is an article on phpbuilder about doing this, take a peak at > http://www.phpbuilder.com/columns/nair20020523.php3 > > Alternatively you could try using PDFlib or similair library, which would > allow them to be opened in all platforms that support Adobe Acrobat. Not > looked into this one much though. > > Hope this helps. > > Cheers > > Lee > > ----- Original Message ----- > From: "Benjamin Woen" <benwoenindosat.net.id> > To: <php-generallists.php.net> > Sent: Sunday, July 21, 2002 10:26 AM > Subject: [PHP] To print in PHP > > > > Dear all, > > > > I am using PHP+MySQL to develop a database app, I want to include > > printing feature in this application that able to print > > to a standard format instead of using print function from the browser, > > anybody in this list that ever do something like this ? > > Appreciate if you can share with me the trick > > > > Thanks and best regards > > > > Ben Woen > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > >

    attached mail follows:


    Instead of outputting a header to redirect the browser would it be safer to use the meta-refresh tag?

    The reason I ask is because I heard that some versions of IE have trouble with the header

    --
    JJ Harrison
    webmastertececo.com
    www.tececo.com