I don't know if this can be done via PHP or not, but here goes...
I have a site that shows a single pop-under when the user enters the site. As long as they are on the site (or 1 hour whichever comes first), they do not see another pop-under.
if(isset($_COOKIE['x'])){
$showpop = $_COOKIE['x'];
$cname = "tfnpop";
$cvalue = "1";
$cexpire = time()+60*60;
setcookie($cname, $cvalue, $cexpire);
}else{
$cname = "x";
$cvalue = "1";
$cexpire = time()+60*60;
setcookie($cname, $cvalue, $cexpire);
$showpop = 0;
}
if ($showpop == 0){
include "popurl.php";
}
I want to show them a single pop-under when they exit the site. Is there a way to trigger it when they leave the site?