Hello folks,
Ive recently installed Apache 1.3.3, MySQL 5, and PHP 5 on a Windows 2000 Professional workstation. When i place a
<? phpinfo(); ?>
page into the root directory and fire it up it works fine, it gives me all the PHP config stuff. However ive created a simple sendform program in the root directory and it wont work.
The PHP sendform script is as follows:
<?php
$msg = "Name:\t$POST[name]\n";
$msg = "Address:\t$POST[address]\n";
$msg = "Company:\t$POST[company]\n";
$msg = "Phone Number:\t$POST[phone]\n";
$msg = "Description of Work Requested:\t$POST[description]\n";
$recipient = "mailaddress@hotmail.com";
$subject = "Service Request from the Website";
$mailheaders = "From: Safeway Electric Co. Website <> \n;
$mailheaders .= "Reply-To: $_POST[sender_email]\n\n";
mail($recipient, $subject, $msg, $mailheaders);
echo "<HTML><HEAD><TITLE>Request Sent!</TITLE></HEAD><BODY>";
echo "<H1 align=center>Thank you $_POST[name],</H1>";
echo "<P align=center> your service request was sent.</P>";
echo "<P align=center> Your service manager will contact you shortly.</P>";
echo "</BODY></HTML>";
?>
and the HTML doc that calls it is as follows:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form name="form1" method="post" action="sendform.php">
<table width="500" border="0">
<tr>
<td width="162">Name</td>
<td width="228"><input name="name" type="text" id="name" size="40"></td>
</tr>
<tr>
<td>Address</td>
<td><input name="address" type="text" id="address" size="40"></td>
</tr>
<tr>
<td>Company</td>
<td><input name="company" type="text" id="company" size="40"></td>
</tr>
<tr>
<td>Phone Number</td>
<td><input name="phone" type="text" id="phone" size="40"></td>
</tr>
<tr>
<td>E-Mail Address</td>
<td><input name="sender_email" type="text" id="sender_email" size="40"></td>
</tr>
<tr>
<td><p>Description of Service</p></td>
<td><textarea name="description" cols="60" id="description"></textarea></td>
</tr>
</table>
<p>
<input type="submit" name="Submit" value="Submit">
<input type="reset" name="Submit2" value="Reset">
</p>
<p> </p>
<p> </p>
<p> </p>
</form>
</body>
</html>
Pretty simple stuff but when you click the submit button the result is all the PHP in the handler script being displayed in the browser. Also, if I look in the root directory, the PHP files still have a text file icon associated with them. Has anyone any suggestions? Could it be that these versions of Apache and PHP are not compatible?