url history

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
chuckhodge
Forum Newbie
Posts: 1
Joined: Wed Nov 13, 2002 10:54 am

url history

Post 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?
User avatar
musashi
Forum Commoner
Posts: 39
Joined: Tue Jul 23, 2002 12:51 pm
Location: Santa Cruz - CA

Two ideas

Post 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"]
Post Reply