I am trying to use a drop down menu to allow people to choose between a number of email address but need a way to alert the visitor that if they don't choose one the email will not be sent.
Here is the code now...
if(isset($Submit))
{
if($name != "" && $email != "" && $category != "")
{
$message = "Email from the AAIRP.com Website:<br><br>
Name: $name<br>
Email: $email<br>
Location: $where<br>
Comment/Question: $needs<br>
Phone Number: $number";
$headers = "MIME-Version: 1.0\n";
$headers .= "Content-Type: text/html; charset=iso-8859-1\n";
$headers .= "From: <$email>\n";
$headers .= "Reply-To: <$email>\n";
//comment this is the new code
if (strstr($email, '@') == '@aairp.com') {exit('nice try');}
mail("$category", "Email from the Website", $message, $headers);
header("Location: thanks.htm");
}
else
{
$error = "y";
}
}
and the form....
<form name="contactus" action="contactus.php" method="post">
<?php
if($error == "y")
{
echo "<font color=#666666 size=2 face=Verdana, Arial, Helvetica, sans-serif>Please fill in the name and e-mail.";
exit;
}
?>
<br>
<br>
<table width="322" border="0" cellspacing="0" cellpadding="0">
<tr align="left" valign="top">
<td width="113">Name: </td>
<td width="209"><input name="name" type="text" id="name3">
<br></td>
</tr>
<tr align="left" valign="top">
<td>E-Mail Address: </td>
<td><input name="email" type="text" id="email">
<br></td>
</tr>
<tr align="left" valign="top">
<td>Location:</td>
<td><input name="where" type="text" id="where2">
<br></td>
</tr>
<tr align="left" valign="top">
<td>Email Subject: </td>
<td><select name="category" id="category">
<option>Select a category</option>
<option value="email@email.com">Quote Information</option>
<option value="email@email.com">Existing Site Question</option>
<option value="email@email.com">Support</option>
</select>
<br></td>
</tr>
<tr align="left" valign="top">
<td>Type your message here: </td>
<td><textarea name="needs" id="textarea"></textarea>
<br></td>
</tr>
<tr align="left" valign="top">
<td>Phone Number:</td>
<td><input name="number" type="text" id="number"></td>
</tr>
</table>
<blockquote>
<p align="left" class="style3"><br />
<input name="Submit" type="submit" id="Submit2" value="Send" />
</p>
</blockquote>
</form>
Any Suggestions???
I thought as well this may deter some bots as there is action required to send it??
Thanks!!!