I’m using a PHP web script and am trying to move the Contact Form to another page. But after “submitting”(successfully) and then refreshing the page I see this (image attached). If I select ‘Continue’ the Form submits the info again. If I select ‘Cancel’ the box disappears, but reappears upon a page refresh.
Here’s the code:
<form action="../page.php?page=1" method="post" name="contact_us" onSubmit="return capCheck(this);">
<tr>
<td>
<input id="name" name="name" value="NAME" onfocus="if (this.value=='NAME') {this.value=''; this.style.color='#000000';}" onclick="clickclear(this, 'Enter Name')" onblur="clickrecall(this,'Enter Name1')" />
</td>
<td>
<input id="name" name="email" value="EMAIL" onfocus="if (this.value=='EMAIL') {this.value=''; this.style.color='#000000';}" onclick="clickclear(this, 'Enter Email')" onblur="clickrecall(this,'Enter Email1')" />
</td>
<td>
<input id="name" name="subject" value="SUBJECT" onfocus="if (this.value=='SUBJECT') {this.value=''; this.style.color='#000000';}" onclick="clickclear(this, 'Enter Subject')" onblur="clickrecall(this,'Enter Subject1')" />
</td>
</tr>
<tr>
<td colspan="3"><input id="textbox1" name="comments" value="COMMENTS" onfocus="if (this.value=='COMMENTS') {this.value=''; this.style.color='#000000';}" onclick="clickclear(this, 'Enter Comments')" onblur="clickrecall(this,'Enter Comments1')" />
</td>
</tr>
<tr>
<td>
<input id="captext" type="text" name="captext" style="maxlength="6" value="" /></td>
<td><img src="../includes/captcha.php" border="0" id="verification_image" /></a><a onclick="refresh_security_image(); return false;" style="cursor:pointer; margin:0px 0px 0px 0px;"><u>Refresh Image</u></a>
</td>
<td><input type="hidden" name="submited" value="1" /><input class="my-input" type="submit" value="SEND MESSAGE">
</td>
</tr>
</form>
if($_POST['submited'] == "1"){
$your_email = "support@......com"; //This is your email address -
$from = "From: contact-form@......com". "\r\n";
$user_email = $_POST['email'];
$user_name = $_POST['name'];
$subject = $_POST['subject'];
$email_body = $_POST['comments'];
if($user_email == "" or $user_name == "" or $subject == "" or $email_body == ""){
$error = "Please Complete All Required* Fields";
}else{
$message = "ContactUs : \n \nUsers Email : $user_email \nUsers Name : $user_name \n\n\n Users Message : \n\n$email_body";
//SEND THE EMAIL -
mail($your_email, $subject, $message, $from);
$result = "Your Message Has Been Sent. Thank You";
}
}
$message = "ContactUs : \n \nUsers Email : $user_email \nUsers Name : $user_name \n\n\n Users Message : \n\n$email_body";
Any help will be appreciated.