Re: where do they go? How can I gather Click info in PHP
- From: "windandwaves" <winandwaves@xxxxxxxxxxxx>
- Date: Mon, 2 May 2005 12:31:29 +1200
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.com</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.
.
- References:
- where do they go? How can I gather Click info in PHP
- From: windandwaves
- Re: where do they go? How can I gather Click info in PHP
- From: Guenther Schmidt
- where do they go? How can I gather Click info in PHP
- Prev by Date: Re: can't understand flock()
- Next by Date: Re: PHPSESSID expires before my cookie
- Previous by thread: Re: where do they go? How can I gather Click info in PHP
- Next by thread: PHP IDE with refactoring capabilities?
- Index(es):
Relevant Pages
|
|