Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with Apache not processing PHP form input?

Status
Not open for further replies.

THE4MAN

Technical User
Mar 17, 2002
73
0
0
US
OK, It's 4AM, I've been trying to figure out this problem for 8 hours on my own now with no luck.

I'm using Dreamweaver MX to create a couple of PHP test pages. Just wanting to input a name and have it say thank you, "name" on a second page. Really easy stuff, I know, but here's what happens...

I get the first page (test_form.php) authored correctly with the following code:

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">[/URL]
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml">[/URL]
<head>
<title>Test Form</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>

<body>
<form name="frm_name" id="frm_name" method="post" action="test_form_processor.php">
  First Name 
  <input name="firstName" type="text" id="firstName" />
  <input type="submit" name="Submit" value="Submit" />
</form>
</body>
</html>

Then I create the second page (test_form_processor.php) with the following code:

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">[/URL]
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml">[/URL]
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>

<body>

<p>Thank you, <?php echo $_POST['firstName']; ?>, for filling out my form. </p>
</body>
</html>

When I run the first page, I get the prompt to enter the name. I do and click the button. The second page that is displayed omits the name I entered on the first page(displaying nothing in it's place). The source code for the 2nd page, instead of displaying the name in HTML, shows the actual PHP code: <?php echo $_POST['firstName']; ?>

Here's the other important stuff. I successfully installed Apache 2.0.50 and PHP 4.3.8. I get the Apache screen at and I get the PHP info screen when I execute a phpinfo file in the localhost folder. So both would appear to be running correctly. This is on a Win2000 Pro machine with SP4 installed.

What's going on here? Is Apache not processing PHP correctly? Or is PHP not configured correctly to work with Apache? Or something else altogether?

Thanks in advance for any help you can provide.

Dave Fore
 
In how many places have you cross-posted this?"

PHP group - since I didn't know if it was a PHP or Apache issue

Apache group - same reason

Dreamweaver group - since that is the app I used to construct the pages

Web Designers group - since that is where this stuff will be deployed

So 4 of the 17 groups that I subscribe to.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top