Jump to content

Sessions


Nitestarz78

Recommended Posts

I have an "Email a Friend" form that captures the referring url and saves it in a session.  The problem is that if someone decides not to send the form and navigates away from the page, and then decides to email another page, it saves the previous url.  How can I have it so that it clears the previous url and uses the new one?

 

if(!isset($_SESSION['referrer'])){
//get the referrer
if ($_SERVER['HTTP_REFERER']){
$referrer = $_SERVER['HTTP_REFERER'];
}
else{
$referrer = "http://www.mcse-training-classes.com";
}
//save it in a session
$_SESSION['referrer'] = $referrer; 
}

Link to comment
https://forums.phpfreaks.com/topic/223283-sessions/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.