Henry Starcher
asked on
PHP Form not filling in header info
I have the following codes for a simple contact email form. The forms get sent correctly, however none of the header info is included. No sent from, subject and so on. Can someone take a look at tell me what is wrong?
Thanks!
Thanks!
<?php
$to = 'info@hcscomputersolutions.com';
$subject = $_POST['inquiryOptions'];
$header = $_POST['emailAddress'];
$message = "From: $fullName\nBusiness Name: $businessName\nSender e-mail address: $header\nSender phone number: $phoneNumber\nPreferred method of contact: $contact\nRegarding: $subject\n\nMessage:\n$comment\n";
if ($header==" ") {
echo "<meta http-equiv=\"refresh\" content=\"0;URL=error.html\">";
exit;
}
$success = mail ($to, $subject, $message, "From: <$header>");
if ($success){
echo "<meta http-equiv=\"refresh\" content=\"0;URL=success.html\">";
}
else {
echo "<meta http-equiv=\"refresh\" content=\"0;URL=failure.html\">";
}
?>
<form action="emailProcessor.php">
<table>
<tr>
<td>Name:</td>
<td><input name="fullName" size="30" tabindex="1" type="text" /></td>
</tr>
<tr>
<td>Business Name:</td>
<td><input name="businessName" size="30" tabindex="2" type="text" /> </td>
</tr>
<tr>
<td>Phone Number:</td>
<td><input name="phoneNumber" size="30" tabindex="3" type="text" /></td>
</tr>
<tr>
<td style="height: 29px">E-mail Address:</td>
<td style="height: 29px"><input name="emailAddress" size="30" tabindex="4" type="text" /></td>
</tr>
<tr>
<td>Preferred Method of Contact:</td>
<td>
<select name="contact" tabindex="5">
<option selected="selected">Phone</option>
<option>E-mail</option>
</select></td>
</tr>
<tr>
<td>Type of Inquiry:</td>
<td><select name="inquiryOptions" tabindex="6">
<option selected="selected">Technical Question</option>
<option>Product Question</option>
<option>Service Question</option>
<option>Other</option>
</select> </td>
</tr>
<tr>
<td>What's on your mind?</td>
<td><textarea cols="70" name="comment" rows="8" tabindex="7"></textarea></td>
</tr>
<tr>
<td> </td>
<td>
<input name="submit" tabindex="8" type="submit" value="Submit" />
<input name="reset" tabindex="9" type="reset" value="Reset" /></td>
</tr>
</table>
</form>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER