- 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?