Okay I took Zapa hint and used the action="support.php. works great but because of the position of my <? ?> statements the first time the user logs on they get:
Enter your name
Enter your email
Enter your phone number
Enter your Operating system
Please, Fill Tell us about your Problem
at the botton of the form. I don't want the users to get these messages the first time they log on to the support.php page I want them to get these messages if they apply after they fill out the for and hit the sumbit button. I tried positioning the php in different locations with no luck. Does someone have a way to resolve this little bug in my script??
Listed below is the PHP script:
<html>
<head>
<title> Support Form</title>
</head>
<body align=center>
<form method="post" action="support.php">
<table width="439" border="0">
<tr>
<td height="49"><object classid="clsid😃27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="300" height="115">
<param name="movie" value="header.swf">
<param name=quality value=high>
<embed src="header.swf" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="300" height="115"></embed>
</object></td>
</tr>
</table>
<p><strong>Name:</strong> <input name="sender_name" type="text" size="30">
<br>
<br>
<strong>Email:</strong> <input name="sender_email" type="text" size="30">
<br>
<br>
<strong>Phone:</strong>
<input name="sender_phone" type="text" size="30">
<br>
<br>
<strong>Windows Operating System:</strong><br>
<br>
Windows 98
<input name="OS" type="radio" value="Win98" >
Windows ME
<input name="OS" type="radio" value="WinME">
Windows 2000
<input name="OS" type="radio" value="Win2000">
Windows XP
<input name="OS" type="radio" value="WinXP">
<br>
<strong><br>
Description of Problem:</strong><br>
<textarea name="message" cols=45 rows=8 id="message"></textarea>
<br>
</p>
<pre>
<input type="submit" name="Submit" value="Submit"> <input type="reset" name="Reset" value="Reset">
</pre>
<?
$errmsg="";
if ($_POST[sender_name]== "") {
$errmsg .= ("Enter your name<BR />");
}
if ($_POST[sender_email]== "") {
$errmsg.= ("Enter your email<BR />");
}
if ($_POST[sender_phone]== "") {
$errmsg.= ("Enter your phone number<BR />");
}
if ($_POST[OS]== "") {
$errmsg.= ("Enter your Operating system<BR />");
}
if ($_POST[message]== "") {
$errmsg.= ("Please, Fill Tell us about your Problem<BR />");
}
if ($errmsg!="") {
echo $errmsg;
}
else
$to = "support@nucitytech.com";
$msg = "Sender's Name: $POST[sender_name]\n";
$msg .= "Sender's Email:$POST[sender_email]\n";
$msg .= "Sender's Phone: $POST[sender_phone]\n";
$msg .= "Sender's OS:$POST[OS]\n";
$msg .= "Message: $POST[message]\n";
$subject = "From NuCityTech Website";
$mailheaders = "From: Nucitytech Support Page\n";
$mailheaders .= "Reply-To:$POST[sender_email]\n";
mail($to, $subject, $msg, $mailheaders);
?>
</form>
</body>
</html>