Apache doesn't seem to recognise PHP files :S

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Apache doesn't seem to recognise PHP files :S

Postby Leighland » 24. August 2008 00:16

I have my html form written as this, saved to register.html:

Code: Select all
<html>
<body>

<form action="register.php" method="post">
<table width="30%">
   <tr>
      <td width="50%">First Name:</td>
      <td width="50%"><input type="text" name="fname" /></td>
   </tr>
   <tr>
      <td width="50%">Last Name:</td>
      <td width="50%"> <input type="text" name="lname" /> </td>
   </tr>
   <tr>
      <td width="50%">Street Address:</td>
      <td width="50%"><input type="text" name="address" /></td>
   </tr>
   <tr>
      <td width="50%">City:</td>
      <td width="50%"><input type="text" name="city" /></td>
   </tr>
   <tr>
      <td width="50%">State/Province: </td>
      <td width="50%"><input type="text" name="state" /></td>
   </tr>
   <tr>
      <td width="50%">Zip/Postal Code: </td>
      <td width="50%"><input type="text" name="postcode" /></td>
   </tr>
</table>

<input type="submit" />
</form>

</body>
</html>



I then have the register.php file setup as this:
Code: Select all
<html>
<body>

Welcome <?php echo $_POST["fname"]; ?>.<br />

</body>
</html>


All it does is greet the first name of the person, just for testing purposes. The file is saved as register.php and i have checked to make sure that there was no additional .txt entensions on it or anything like that.

When I register on the register.html page and click submit, the php page is shown in plain text. It shows me the code rather than processing the php. It does this with every php page I have tried.

Any suggestions?
Leighland
 
Posts: 1
Joined: 24. August 2008 00:10

Postby Wiedmann » 24. August 2008 00:41

When I register on the register.html page

How did you open/load the page "register.html"?
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 58 guests