Click to See Complete Forum and Search --> : Problem in receiving html variable


shahjee
05-08-2003, 09:12 AM
I am facing some problem in receiving HTML variable on PHP page.

when i submit the HTML data on PHP page and display it using echo method it display blank data. Can anyone explain me what mistake i am doing. I am using following code please review

<!--Test.html-->

<html>
<body>
<form action="display.php">
<input type="text" name="nm">
<input type="submit" value="Submit">
</form>
</body>
</html>

/*display.php*/

<?php
echo($nm);
?>

jerdo
05-08-2003, 01:18 PM
If you are using a newer version of PHP (4.2 or later) try this:

echo "$_GET[nm]";

If you were using the POST method on the form it would be "$_POST[nm]", since you didn't specify a method in the form it defaults to GET.

piersk
05-08-2003, 01:19 PM
Try going into php.ini and changing register_globals from off to on.

Ancientmtk
05-27-2003, 01:05 PM
Thank you jerdo!!! i love you!!!! You solved it!!!