Jump to content

Prevent Web page Expired


johnsmith153

Recommended Posts

I know this is ultra basic but I am sure there is a better way than how I do it.

 

I always submit the form to the same page:

 

<?php
$error = "";

if(isset($_POST['submit'])) {

  //check form

  if($formOK==1) {
     //add record and redirect 
  } else {
    //allow page to continue so display form again
   $error = "Not completed";
  }

}

echo $error;

?>
<form>

<input type="text" name="name" value="<?php echo $_POST['name']; ?>">

</form>

 

..so the above always shows the values entered in the form

 

The problem is I get the web-page expired problem.

 

If I header redirect after form submit (either another .php page or the same one) I then lose ability to display values submitted in $_POST.

 

What do I do to get $_POST values but no web-page expired messages?

Link to comment
https://forums.phpfreaks.com/topic/208365-prevent-web-page-expired/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.