Page 1 of 1

Passing Variables error

Posted: Mon Aug 11, 2003 10:56 am
by yonibensimon
Hi guys, i read the sticky on passing variables, but i still got errors!

Here is my html file:

<form action="Handler.php" method="POST">
<input type="text" name="text1">
<input type="text" name="text2">
<input type="submit" value="GO">
</form>

And here is the Handler.php file:

<?php
echo $_POST['text1'];
echo $_POST['text2'];
?>

And here is what i get :

PHP Notice: Undefined index: FirstElement in C:\Documents and Settings\jbensimon\Desktop\forum guy\FormHandler.php on line 8 PHP Notice: Undefined index: SecondElement in C:\Documents and Settings\jbensimon\Desktop\forum guy\FormHandler.php on line 9

Posted: Mon Aug 11, 2003 11:19 am
by nielsene
try sticking a

Code: Select all

print_r($_POST);
at the top of your Handler.php page and see what it prints out.

Posted: Mon Aug 11, 2003 11:39 am
by yonibensimon
I fixed the problem by replacing "post" in the 2 files by "get".

But now i have another problem. All off this work fine in my PHP editor, but on a browser, the php file gives me a blank page !

Posted: Mon Aug 11, 2003 7:41 pm
by JAM
Is this the same error posted twice?