Following the PHP tutorial I got to a frustrating it-should-be-simple:rolleyes: problem with echoing the input text from simple HTML form with simple PHP script.
<html>
<head>
<title>Search</title>
</head>
<body>
<h2>Enter</h2>
<br />
<form action="handle_form.php" method="POST" />
Please enter the name:
<br />
<input name="name" type=text>
<br />
<input type=submit value="search">
</form>
</body>
</html>
<?
echo $name;
?>
I've already made search on forum, found Simple POST no workie thread where NogDog suggest that it has to do something with global variables (as far as I know this considers whether variables are in/outside a function?).
Well, anyway even following NogDog's advice:
echo $_POST['carcol '];/*'name'in my case*/
didn't help as first I had to put quotation marks around the code because echo expected a string and with quotation marks I got an syntax error.
The "closest" I got was with this code
<?
$search = "$_POST('name')";
echo $search;
?>
which returned Array('name'). That was at least something as with echo $name; I only got blank page.
So, what must be done to simply echo what was entered into text form in the HTML page😕