I am trying to study php from a book. But the code doesn't seem to
work for me. I set up a form, as follows:
<html>
<head>
<title>form</title>
</head>
<body>
<form action="results .php" method="GET">
<p>Name: <input type="text" name="name">
<P>
<input type="submit" name="Submit">
<input type="Reset"></form>
</body>
</html>
Then I wrote some code for a processing file titled "results.ph p" as
instructed:
<head>
<title>form results</title>
</head>
<body>
<?php
print("<p>Name : <b>$name</b>\n");
?>
</body>
</html>
But if I type "Jones" in the name field, it doesn't pass the name
value on to the form "results" page. It puts it up in the location bar
as
/php/results.php?nam e=jones&Submit=
But it doesn't appear on the Web page.
What am I doing wrong?
Thanks for any help.
work for me. I set up a form, as follows:
<html>
<head>
<title>form</title>
</head>
<body>
<form action="results .php" method="GET">
<p>Name: <input type="text" name="name">
<P>
<input type="submit" name="Submit">
<input type="Reset"></form>
</body>
</html>
Then I wrote some code for a processing file titled "results.ph p" as
instructed:
<head>
<title>form results</title>
</head>
<body>
<?php
print("<p>Name : <b>$name</b>\n");
?>
</body>
</html>
But if I type "Jones" in the name field, it doesn't pass the name
value on to the form "results" page. It puts it up in the location bar
as
/php/results.php?nam e=jones&Submit=
But it doesn't appear on the Web page.
What am I doing wrong?
Thanks for any help.
Comment