Click to See Complete Forum and Search --> : PHP Post-Error


Anon
03-06-2002, 03:09 PM
Hi!

I have a strange problem..

<Form method=post action="pt.php" name="form1">
<input type="text" name="namnet">
<input type="submit" value="TESTA" name="tst">

When you push the button pt.php is "run".
My problem is that the pt.php file never gets the variables made up in this form.
The complete error given by my win-installation of apache follows:
[Wed Mar 06 19:47:34 2002] [error] PHP Warning: Undefined variable: namnet in c:\program\apache group\apache\htdocs\pt.php on line 7
------- EOF

As you soon might realize is that pt.php is the only file beeing used here.
When I try the exact same file on my linux-apache it works just fine...
PLEASE HELP!

Thanx!

(My system:
WinXP Pro
Apache 1.3
PHP 4.1.1)

dannys
03-06-2002, 07:47 PM
By default, PHP4.1.1+ doesn't register globals, so you'll have to get them from the $_REQUUEST array or similar (you can also use $_GET, $_POST, $_COOKIE etc but afaik $_REQUEST has all of the vars).

To get the vars from your form you simply write :

$namnet=$_REQUEST['namnet'];

Or you can work directly with the $_REQUEST['namnet'] var if you wish (it's a superglobal so it's scope covers all of your functions too, which is nice)

HTH.

Anon
03-07-2002, 05:14 PM
Thanx!!!!!

You're my god!!! :)
Strange that you don't need
the $_ReQUEST in linux though...
Well.. I'm more than happy that you solved
my problem.. I've tried it and it works
out perfect!!!!

THANX A-MEGA-LOT !!!