Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.