nko
12-16-2003, 02:34 AM
I feel like a jerk asking a question that's probably been asked a million times, but I'm not sure how I'd search for this problem, so I'm posting it here :-)
I started looking in to PHP today. I'm trying to set up an HTML form that passes a single text string to a form-handling PHP page.
This is my HTML form:
<html>
<head><title>Test PHP Form</title></head>
<body>
<form action="formhandler.php" method="post">
First Name <input type="text" name="FirstName" size="20">
<input type="submit" name="submit" value="Submit">
</form>
</body>
</html>
This is the handler to which it refers:
<html>
<head>
<title>Handler</title>
</head>
<body>
<?php
print("Hello, $FirstName");
?>
</body>
</html>
It invariably produces the following output:
Hello,
Any idea what I'm doing wrong? If it helps, it's being served on the local machine. Apache's the server. I've also tried the GET method, but it didn't change anything.
Thanks!
I started looking in to PHP today. I'm trying to set up an HTML form that passes a single text string to a form-handling PHP page.
This is my HTML form:
<html>
<head><title>Test PHP Form</title></head>
<body>
<form action="formhandler.php" method="post">
First Name <input type="text" name="FirstName" size="20">
<input type="submit" name="submit" value="Submit">
</form>
</body>
</html>
This is the handler to which it refers:
<html>
<head>
<title>Handler</title>
</head>
<body>
<?php
print("Hello, $FirstName");
?>
</body>
</html>
It invariably produces the following output:
Hello,
Any idea what I'm doing wrong? If it helps, it's being served on the local machine. Apache's the server. I've also tried the GET method, but it didn't change anything.
Thanks!