php - Session values are not stored after submiting the form -


here enquiry form code..the session not stored after form submission on ie form not retaining values in google chrome fine..all fields in form emptied after submission..i want store values if captcha code incorrect.. can 1 plz help

                <?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 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 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> 


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -