Jump to content

go back 2 pages with loaded page refreshed


kalster

Recommended Posts

when the user clicks the submit button from a html form, it needs to go back two pages with that loaded page refreshed. for the javascript i only have history.go(-2);  with php, I have tried cookies and sessions which i discovered that neither will work because the loaded page is not refreshed. I could do a html body onload but that would break the w3c validator. what are my options?

Sounds more like a Redirect to me. And if that's what it really is, then I'm not entirely sure why you're trying to use the browser's history for it.

 

Assuming your form submits to some php script that updates the formentioned data displayed on the previous-previous page (-2), you can simply redirect back to that page upon finishing the update of data in the script.

 

Or am I assuming wrong?

when the user clicks the submit button from the form, the next page loaded is a process page. after that page is finished, it then needs to go back two pages in history to get the page that was loaded before the form was loaded and that page can be different every time.

 what are my options?

 

just put your form and form processing on the same page. in this case the only redirecting you will need is one to the exact same url/page after you have processed the form data, to cause a get request for that same url/page to cause the browser to not try and submit the same post data again.

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.