I have problem reading posted variables from a simple form
Posted: Sun Jun 01, 2008 10:56 am
Hi folks,
I am a kind of newbie to php world. I have written a simple HTML form tag which sends data to a php script. Php script is in a separate file. In php script, I am just printing out what user writes in the html form. Here is the html tag:
Here is result.php:
note that the name i am printing should come from user input. But I get a blank page. Browser sets the path to php script in address bar, nothing is running.
Could anyone please help me.
Thanks in advance.
Arjun
I am a kind of newbie to php world. I have written a simple HTML form tag which sends data to a php script. Php script is in a separate file. In php script, I am just printing out what user writes in the html form. Here is the html tag:
Code: Select all
<!doctype html public "-//W3C//DTD HTML 4.0 //EN">
<html>
<head>
<title>My search Engine!</title>
</head>
<body>
<h2> Search for a fruit </h2>
<br>
<FORM ACTION="result.php" METHOD="POST">
Please enter the name, or part of the name or the fruit your looking for:
<br>
<INPUT NAME="name" TYPE=TEXT>
<br>
<INPUT TYPE=SUBMIT VALUE="search">
</FORM>
</body>
</html>
Here is result.php:
Code: Select all
<?php
echo $name;
?>note that the name i am printing should come from user input. But I get a blank page. Browser sets the path to php script in address bar, nothing is running.
Could anyone please help me.
Thanks in advance.
Arjun