$url_string = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
$parse_url = parse_url($url_string);
$host = $parse_url['host'];
$host_arr = explode('.', $host);
$parts = count($host_arr);
$new_host = $host_arr[$parts - 2] . '.' . $host_arr[$parts - 1];
if ($new_host != $host){
//echo " ok if this url has not changed do nothing";
}
else{
//echo " ok if it did then trigger onunload event";
}
/*
Ok if current window is no longer the same $new_host, such as if a frame breaker happen
or if a person closed current window, then it needs to trigger the onunload event, that would popup a php page.
*/
reason it needs to work like this is, because i will need to be able to click links in the frame and by just using a onunload event it seems i get a popup everytime i click a link, so now i am resorting to this method.
So if you know php and javascript, could use a little help in figuring this out.
Right now if I close a window or change urls, of course nothing happens, so now need to get this to work with maybe a onunload or something, but still be able to click link in the frame, but if i would to close window or change url totally, then i need a page to pop up .