Can't pass variable from forms : PHP Version 4.2
Posted: Mon May 13, 2002 9:51 pm
Hi,
I'm using version 4.0.6 before and i recently upgraded my version to 4.2 and now everything isn't working. I know that they turned the register_global off and i'm reading a lot of the alternatives but when I tried it myself it doesn't seem to work. Can somebody look at this code:
How come i'm getting notice like undefined variable submit?
Thanks in advance. I really need to figure out the problem.
-------------------------------------------------------------------------------------
<?php
$PHP_SELF = $_SERVER['PHP_SELF'];
//Handle Input here
//Check if $submit has a value of "Go" - The Validator
if($submit=="Go"){
//The Processor
echo("You wrote ".$_POST["you_wrote"]);
echo("<br>You could have done whatever you want with the input instead");
exit;
}
?>
<!-- The Frontend HTML form -->
<form action="<?php echo $PHP_SELF ?>" method="POST" >
<p>Input a word <input type="text" size="20" name="you_wrote">
<input type="submit" name="submit" value="Go"></p>
</form>
-------------------------------------------------------------------------------------
I'm using version 4.0.6 before and i recently upgraded my version to 4.2 and now everything isn't working. I know that they turned the register_global off and i'm reading a lot of the alternatives but when I tried it myself it doesn't seem to work. Can somebody look at this code:
How come i'm getting notice like undefined variable submit?
Thanks in advance. I really need to figure out the problem.
-------------------------------------------------------------------------------------
<?php
$PHP_SELF = $_SERVER['PHP_SELF'];
//Handle Input here
//Check if $submit has a value of "Go" - The Validator
if($submit=="Go"){
//The Processor
echo("You wrote ".$_POST["you_wrote"]);
echo("<br>You could have done whatever you want with the input instead");
exit;
}
?>
<!-- The Frontend HTML form -->
<form action="<?php echo $PHP_SELF ?>" method="POST" >
<p>Input a word <input type="text" size="20" name="you_wrote">
<input type="submit" name="submit" value="Go"></p>
</form>
-------------------------------------------------------------------------------------