Page 1 of 1

url history

Posted: Wed Nov 13, 2002 10:54 am
by chuckhodge
here's the problem: I have a page that can be accessed from multiple pages. It has a database form with an update and a second form with a submit button to return to the calling page. the problem is that on the update the page becomes the referer and so it wants to go back to itself (I'm using $mycallpage = HTTP_SERVER_VARS["HTTP_REFERER"] to retieve the calling page and then use the variable in the second form action to return to the calling page.) how can this be accomplished successfully?

Two ideas

Posted: Wed Nov 13, 2002 5:42 pm
by musashi
There are two thoughts on this:

One you could use session variables, and store the referrer page address.

Or... which I think you'll like better...

Have a variable in the update form called $mycallpage so that you keep the original referrer. The code should also do the following:

if HTTP_SERVER_VARS["HTTP_REFERER"] != current page
$mycallpage = HTTP_SERVER_VARS["HTTP_REFERER"]
else
$mycallpage = $_REQUEST["mycallpage"]