Jump to content

Recommended Posts

I have a form that gets filled out from the result set of an SQL query. The user is presented with forward and back buttons to traverse the result set.

The user also has the option of editing any given result set, this is then posted to another page for validation and to let the user determine if their input is correct by showing the user the input/edits.

If the user decides that the edits are correct these are then posted to the database.
If the user decides that no, these are not correct they have the option of going back too the form where the variables are posted back and refill out the form.

Now for whatever reason the user may decide that they want to check another record by utilizing the navigation buttons described earlier.

But because the form now displays posted variables, the form navigation does not work.
Ive tried using unset which does destroy the variables, but because of the nature of the application, whereby the navigation buttons, once clicked refresh the page these same post variables that have been destroyed in the script are again reloaded from the browser cache.

Is there anyway around this, or has anyone here come across a simiiliar problem and dealt with this some other way?

Link to comment
https://forums.phpfreaks.com/topic/35097-unsetting-post-variables/
Share on other sites

with forms that involve a page refresh, i personally use a mixture of sessions (to store the data before it's confirmed) and a 'header' redirect (ie, header("Location: /wherever.php") ). This clears out any $_POST data you may have and avoids the "submit this form again?" message you get.
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.