May
Contact form not sending
<form name="contact" method="post" action="send.php">
<table width="100%" border="0">
<tr>
<td>E-Mail:</td>
<td><input type="text" name="email" /></td>
</tr>
<tr>
<td>Subject:</td>
<td><input type="text" name="subject" /></td>
</tr>
<tr>
<td>Message:</td>
<td><textarea name="message" cols="30" rows="10"></textarea></td>
</tr>
<tr> <td></td><td><input type="submit" value="Send E-Mail" /></td></tr>
</table> </form>and the send.php page
<?php
$email
= $_POST[‘email’];
$subject = $_POST[’subject’];
$message = $_POST[‘message’];
?>
<!DOCTYPE html PUBLIC ”-//W3C//DTD XHTML 1.0 Transitional//EN” ”http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ />
<link type=”text/css” rel=”stylesheet” href=”../css/style.css” />
<title>Gaming Info :: Contact Us</title>
<style type=”text/css”>
<!–
.style2 {
font-size: 18px
}
–>
</style>
</head>
<body><div id=”header”></div>
<div id=”nav”>
<ul>
<li><a href=”../index.html”>Home</a></li>
<li><a href=”../reviews”>Reviews</a></li>
<li><a href=”../dates”>Release Dates</a></li>
<li><a href=”../contact”>Contact Us</a></li>
</ul>
</div>
<div id=”content”>
<div class=”left-col”> <p class=”style1 style2″><strong>Contact Us</strong></p>
<?php
if(empty($email) || empty($message) || empty($subject) || !strstr($email,“@”) || !strstr($email,“.”)) {
echo ‘<p class=”error”>Please fill in all fields correctly.</p>’;
die (‘ <form name=”contact” method=”post” action=”send.php”>
<table width=”100%” border=”0″>
<tr>
<td>E-Mail:</td>
<td><input type=”text” name=”email” /></td>
</tr>
<tr>
<td>Subject:</td>
<td><input type=”text” name=”subject” /></td>
</tr>
<tr>
<td>Message:</td>
<td><textarea name=”message” cols=”30″ rows=”10″></textarea></td>
</tr>
<tr> <td></td><td><input type=”submit” value=”Send E-Mail” /></td></tr>
</table> </form></div>
<div class=”right-col”> <p class=”style1″>Right</p>
<p class=”style1″>Column</p>
<p class=”style1″>Stuff </p>
<p class=”style1″>Goes </p>
<p class=”style1″>Here</p>
<p class=”style1″>?</p>
<p class=”style1″>?</p>
<p class=”style1″>?</p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p></div>
<br style=”clear:both” />
</div>
</body>
</html>
‘);
}
$from = “From: $email\r\n”;
mail(“email@host.co.uk”, $subject, $message, $from);
?>
<p>Thank you, your E-Mail has been sent.</p>
</div>
<div class=”right-col”> <p class=”style1″>Right</p>
<p class=”style1″>Column</p>
<p class=”style1″>Stuff </p>
<p class=”style1″>Goes </p>
<p class=”style1″>Here</p>
<p class=”style1″>?</p>
<p class=”style1″>?</p>
<p class=”style1″>?</p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p></div>
<div align=”center”><br style=”clear:both” />
Design by <a href=”http://www.sgilligan.co.uk”>SGilligan.co.uk</a></div>
</div>
</body>
</html>
if you want to test. You have to change the e-mail in the script
Thanks
Relevant Links

