The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Threaded View

Referrer won't remain constant in a variable

I have a page called, displayContact.php. This page pulls up the details for a given user in the database. I have designed this page to accept a uID from several other pages, so there are many pages that can send me to displayContact.php. I'm trying to fix it so that when I click the "Update Database" button, it displays a text link that will allow me to return to the other page that brought me to displayContact.php in the first place. displayContact.php simply reloads itself when the "Update Database" button is clicked.

My problem is that the $sendBack URL is never the URL of the webpage that brought me to displayContact.php Does this make sense? Here is my code. I've attemped to write it so the referrer would not be over-written when displayContact.php reloads to update the database with changes made. This code appears in the section on my page where it checks for the action... if $action=viewRecord. If my understanding is correct, this code should only be executed once, that is, when the page is first loaded. But somehow $sendBack is being changed when the page reloads.