Re: Re: A tricky one?

From: Date: Wed, 21 Nov 2001 00:07:59 +0000
Subject: Re: Re: A tricky one?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-75330@lists.php.net to get a copy of this message
switch the isset() with !empty() At 21:51 20/11/01 +0100, Raymond Lilleodegard wrote:
It works after modifying it a little. BUT... :) It lists all the variables even if they aren't given any value. Is it possible to only get the defined ones? Regards Raymond "Matthew Luchak" <MLuchak@Kaydara.com> wrote in message news:6D3215FF15393442891CAA42DEC51E4944D480@primavera.kaydara.com... how about... <? $message=""; $header="From: $email"; $to="me@here.net"; $subject="burger me";
        while(list($var, $val) = each($HTTP_POST_VARS))
        {
if(($var !="email")&&($var !="SUBMIT")&&(isset($var)){$message .="$val $var were ordered \n";} } MAIL( "$to", "$subject", "$message", "$header" ); ?> ____________________________ Matthew Luchak Webmaster Kaydara Inc. mluchak@kaydara.com -----Original Message----- From: Raymond Lilleodegard [mailto:raymond@lilleodegard.com] Sent: Tuesday, November 20, 2001 1:57 PM To: php-general@lists.php.net Subject: [PHP] Re: A tricky one? Thanks for answering. But this only works if the customer orders one of each. Do you know how to do it if, lets say the customer order 2 hamburgers and nothing else? Raymond "Raymond LilleøDegåRd" <raymond@lilleodegard.com> wrote in message news:20011120174423.84798.qmail@pb1.pair.com... Hi! I'm trying to make this form working with a mail() script. I made this form. Then the customer could write how many "pizzas" or "hamburgers" as he want. But how do I solve this without too much headache? Havent slept for days because of this problem : ) <input type="text" name="pizza"> <input type="text" name="chips"> <input type="text" name="hamburger"> -------- script ---------------- <?php /* recipients */ $to = "someone@online.no" ; /* subject */ $subject = "Order"; /* message */ $message = "I would like to order $?"; /* To send HTML mail, you can set the Content-type header. */ /* additional headers */ $headers = "From: Someone <someone@someone.com>\r\n"; /* and now mail it */ mail($to, $subject, $message, $headers); Best regards Raymond -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net
_____________________________ . Christian Dechery . . Gaita-L Owner / Web Developer . . http://www.webstyle.com.br . . http://www.tanamesa.com.br

« previous php.general (#75330) next »