Variables coming from forms
| From: | Achilles Maroulis | Date: | Sun, 22 Sep 2002 07:03:30 +0000 |
| Subject: | Variables coming from forms | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-21898@lists.php.net to get a copy of this message | ||
Hi. I have posted this thread before but didn't come to a solution so I try
again.
I've installed Apache 2.0 and PHP 4.2.3 (both with the msi installers) on
Windows 2000 Pro.
The problem I have is that I get the message
Notice: Undefined variable: var_name in ....
every time I pass a new variable into another page whether this happens
using the URL or a form or even sessions.
The strange thing is that if I run phpinfo() in the same page (where the
variable is considered to be undefined) I see that my variables do exist in
the variables section of phpinfo.
For example. If I use a form to pass a variable in a php file like this:
<form method="get" action="var.php">
<input type="text" name="var" size="20"
value="test">
<input type="submit" value="Submit">
</form>
and have the var.php like this:
<?php
print("$var");
phpinfo();
?>
I'll get the message:
Notice: Undefined variable: var in C:\Progr.\htdocs\var.php on line 2
while I'll also get a line like this in the variables section of phpinfo():
Variable Value
_GET["var"] the value I typed before
I think this is really strange. Has anyone something to suggest?
Thanx in advance!!
Achilles