这是我的查询表单代码...在IE上提交表单后没有存储会话表格没有保留谷歌浏览器中的值,这很好..所有表单中的字段都在提交后清空.i想要在验证码不正确时存储值。 任何人都可以帮助
<?php
session_start();
ob_flush();
include("header.php");
if(isset($_POST["Submit"]))
{
if ($_POST["vercode"] != $_SESSION["vercode"] OR $_SESSION["vercode"]=='')
{
$msg="Incorrect verification code";
$ssubject = $_POST['Subject'];
$name = $_POST['name'];
$address = $_POST['address'];
$_SESSION['Subject'] = $ssubject;
$_SESSION['name'] = $name;
$_SESSION['address'] = $address;
}
else
{
$email_to="abc@gmail.com";
$ssubject = $_POST['Subject'];
$name = $_POST['name'];
$address = $_POST['address'];
$to = $email_to;
$subject="Message from my Website Inquiry"." ".date("D dS M,Y h:i a");
$header="from: craze $email";
$messages= "INQUIRY\r\n\r\nSUBJECT: $ssubject\r\n\r\nNAME: $name \r\n\r\nADDRESS: $address \r\n\r";
$sentmail = mail($to,$subject,$messages,$header);
if($sentmail)
{
$success="Your Contact Details Has Been Sent To Administrator Address.";
unset($_SESSION['Subject']);
unset($_SESSION['name']);
unset($_SESSION['address']);
}
}
}
?>
<form id="form1" name="email_check" onSubmit="return validateForm()" method="post" action="">
<select name="Subject">
<option value="Complaint">Complaint</option>
<option value="Appointment Request" selected="selected">Appointment Request</option>
<option value="Doctors inquiry">Doctor's Inquiry</option>
<option value="Service Inquiry">Service Inquiry</option>
<option value="Other">Other</option>
</select>
<input name="name" class="text_box" type="text" value="<?php echo $_SESSION['name'];?>"/>
<textarea class="text_boxlarge" name="address"><?php echo $_SESSION['address'];?></textarea>
<div class="namepart"><h5>Enter Code</h5></div>
<div class="tex_part">
<img src="captcha.php">
<input type="text" name="vercode"
class="text_box" style="width:120px;margin-top:16px;" />
</div>
</div>
<input name="Submit" type="image" src="images/submit_burron1.jpg" height="20" width="54" value="Submit" />
<input name="cancel" type="image" src="images/reset_button.jpg" height="20" width="54" usemap="#Map2Map" />
</form>