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?

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Edited by kalster
Link to comment
Share on other sites

 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.

Link to comment
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.