Guenther Schmidt wrote:
Windandwaves
this is acutally rather easy.
the link that people click on should be something like:
<a href="/redirect.php?destinationURL=www.cnn.com">www.cnn.c om</a>
in redirect.php
you would code whatever is necessary to write the destination URL
into the database and then redirect the visitor to the intended
destination by doing:
header ('Location: '.$_REQUEST['destinationURL']);
that's all.
If you want to find out *where they come from* there is a variable
called HTTP_REFER or something like that. Study the output of
phpinfo(); to find the exact name.
There is a tutorial/article for exactly this called "where they went,
where they came from" on http://www.phpbuilder.com
Good luck!
Günther
Here is what I did:
//link to database
$bot = browser_detection("type");
if(strlen($p) == 3){
$pageowner= $p;
}
if($h == 1) {
$httper = "http://".$pageownerwebsite;
}
elseif($h == 2) {
$httper = "http://".$pageownersecondsite;
}
else {
$httper = "http://www.myurl.co.nz/404.php";
}
$sqllog = 'INSERT INTO `LOG` ( `field1` , `field2` , `field3`, `field4` )
VALUES (NOW() , "'.$pageowner.'", "clicked","'.$httper.' ('.$bot.')" );';
$logger = mysql_query($sqllog);
$locationer = $httper;
header("Location: $locationer");
?>
It seems to be working well.