I used this script on my previous site and it worked, however, it is not working for me now.
contactme.html
submit.php
Here's the page that I had on my site:
http://www.fu-singapore.uni.cc/contactme.html
Problem
All help appreciated.
contactme.html
Code:
<form method="post" action="submit.php">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr bgcolor="#CCCCCC">
<td colspan="2"><font size="4">Contact Me </font></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td>Name:</td>
<td width="91%"><input type="text" name="name" size=35 maxlength=75></td>
</tr>
<tr>
<td width="9%"> </td>
<td> </td>
</tr>
<tr>
<td>Email:</td>
<td><input type="text" name="email" size=35 maxlength=75></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td>Subject</td>
<td><input type="text" name="subject" size=35 maxlength=75></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td valign="top">Message:</td>
<td><textarea cols=65 rows=10 name="message"></textarea></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="Submit" value="Submit"></td>
</tr>
</table>
</form>
submit.php
Code:
<?php
$mailTo = "starseven@gmail.com";
$mailFrom = "From: $name <$email>\n";
if ($message != "") {
if (mail($mailTo, $subject, $message, $mailFrom)) {
echo "Thank you for taking the trouble to send me your message";
}
} else {
echo "Opps, I just detected an empty message! Go back to the <a href=\"javascript:history.go(-1)\">previous page</a> and try again! Thank you.";
}
?>
Here's the page that I had on my site:
http://www.fu-singapore.uni.cc/contactme.html
Problem
It doesn't seem to be going into the if ($message != "") loop, which I don't understand, no matter what I type, it will still take message = "".
All help appreciated.