RE: [PHP] Undefined variable
| From: | Daniel Kushner | Date: | Wed, 09 Oct 2002 12:33:00 +0000 |
| Subject: | RE: [PHP] Undefined variable | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-119418@lists.php.net to get a copy of this message | ||
Try using $_POST['name'] or $_GET['name'].
E.g.:
<?php
print "my name is $_POST[name]";
?>
Regards,
Daniel Kushner
_________________________________________
Need hosting? http://thehostingcompany.us
-----Original Message-----
From: Muhammad Khairuzzaman [mailto:wizbug@wizbugdesign.com]
Sent: Wednesday, October 09, 2002 8:22 AM
To: php-general@lists.php.net
Subject: [PHP] Undefined variable
I'm trying to process data from a form, regardless whether I'm using GET
or POST method, the value that i get in the processed form is still
null.
I check in the error log file and this is what it say:
[Wed Oct 09 20:18:47 2002] [error] PHP Notice: Undefined variable:
name in e:\program files\apache group\apache\htdocs\test.php3 on line 3
Or is there something wrong in my code? Or something with my setting?
<form method=GET action=test.php3>
<tr>
<td width="50%" style="border-style: none; border-width: medium"
height="20">
<p>Name: <input type="text" name="name"
size="20"></p>
<p> </p>
<p><input type="submit" value="Submit"
name="submit"><input
type="reset" value="Reset" name="B2"></p> </form>
------------------------------------------------------------------------
----
-----------------------
<html>
<?php
print "my name is $name";
?>
</html>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php