Hello All,
In the past I have had situations where I needed to move to another URL (with a form handling validation) and then go back to the original page.
Example
url1 - Link to url2 (i.e modify contact details)
url2 - contains form
url2 - posted values - validate - upkeep database - header (location=url).
To perform this I normally use $_SERVER['HTTP_REFERRER'] and passed that into url2. url2 retains that value through the post and knows when the form is correct to move to back.
I have recently been told that proxies can fool/confuse this methodology.
What are the preferred/alternative methods of achieving this functionality. No cookies/javascript/session saving unfortunately (due to legacy/customer requirements)
Storing current page and go-back to it later
Moderator: General Moderators
- CoderGoblin
- DevNet Resident
- Posts: 1425
- Joined: Tue Mar 16, 2004 10:03 am
- Location: Aachen, Germany
-
kettle_drum
- DevNet Resident
- Posts: 1150
- Joined: Sun Jul 20, 2003 9:25 pm
- Location: West Yorkshire, England
- CoderGoblin
- DevNet Resident
- Posts: 1425
- Joined: Tue Mar 16, 2004 10:03 am
- Location: Aachen, Germany
[Solved] Storing current page and go-back to it later
Thanks kettle_drum. That's what I thought someone would say... Really wanted to avoid passing the url but will do it that way unless someone comes up with a better idea.
-
kettle_drum
- DevNet Resident
- Posts: 1150
- Joined: Sun Jul 20, 2003 9:25 pm
- Location: West Yorkshire, England
Well you will always be technically passing the url as that is what happens to get the url in the http_referrer variable. If you dont want the user to physically see it in the URL (which is probably the case - as it will make the URL look messy), place the URL in a session or cookie each time a page is loaded and then on the next page read this value before you replace it with the page just loaded details.
Its easy enough to do, the user doesnt see it, and it will ensure that the value is always present and correct.
Its easy enough to do, the user doesnt see it, and it will ensure that the value is always present and correct.