Re: POST in Apache server
| From: | Casey Chu | Date: | Sat, 16 Dec 2006 05:55:02 +0000 |
| Subject: | Re: POST in Apache server | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-245909@lists.php.net to get a copy of this message | ||
Hmmm... there's something wrong with the form sending its values.
Try
echo "<pre>";
print_r($GLOBALS);
echo "</pre>";
On 12/15/06, Emiliano <emi.mi@libero.it> wrote:
ok, this is what I get: <pre>Array ( ) </pre> PHP Notice: Undefined index: val1 in /net/people/user/public_html/cgi-bin/mail.php on line 18 PHP Notice: Undefined index: val2 in /net/people/user/public_html/cgi-bin/mail.php on line 20 -emiliano On your script page, add echo "<pre>"; print_r($_REQUEST); echo "</pre>"; and tell us the result. On 12/15/06, Emiliano <emi.mi@libero.it> wrote:Yes Casey, I'm using the submit button -emiliano------------------------------------------------------ Passa a Infostrada. ADSL e Telefono senza limiti e senza canone Telecom http://click.libero.it/infostrada16dic06------------------------------------------------------ Passa a Infostrada. ADSL e Telefono senza limiti e senza canone Telecom http://click.libero.it/infostrada16dic06 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.phpOn Fri, December 15, 2006 7:39 pm, Emiliano wrote:PHP Notice: Undefined index: val1 in /net/people/user/public_html/cgi-b= in/script.php on line 14On Fri, December 15, 2006 8:15 pm, Emiliano wrote:http://php.net/issetsorry for bothering you, but can you please give me few more details about how to use isset to solve my problem?Well, in line 14, where you start using $_GET['val1'] or $_POST['val1'] or $_REQUEST['val1'] without bothering to check if it exists or not, put in a check to see if it exists before you try to use it. Something like: <?php if (isset($_POST['val1']){//do something with val1 now that we know it's here} //don't do anything with 'val1' cuz she's not there ?> -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So?