exit link tracking / urlencode help!
Posted: Mon Nov 28, 2005 6:48 am
I need to be able to log users clicking on external links, and i was provided with a PHP script to link to the outside ->
The first example is what i put where the Link is
Code:
<A href='exit.php?url=www.insertlinkhere.com'>
Then the code within the exit.php file is
Code:
So i have used this script but since my links are quite sophisticated using other link tracking etc.. so i found out that i'm supposed to use the PHP "urlencode" function, now i'm a PHP Beginner and i thought that i should put the urlencode in like this
Code:
but it doesn't work?! am i doing something wrong? it passes through properly i think but it doesn't actually go to the page?!
the external links that i use are similiar to this format:
http://www.sampleurl.com/x/?s=r&t=u&v=X ... 1&p=000000
so the PHP urlencode is supposed to change the ampersands i assume and pass it on thru the exit.php and refresh to the actual external link.
Hope i haven't confused.
The first example is what i put where the Link is
Code:
<A href='exit.php?url=www.insertlinkhere.com'>
Then the code within the exit.php file is
Code:
Code: Select all
<?php
$url = @$_GET["url"];
header("Location: http://".$url);
exit;
?>Code:
Code: Select all
<?php
$url = @$_GET["url"];
urlencode($url);
header("Location: http://".$url);
exit;
?>but it doesn't work?! am i doing something wrong? it passes through properly i think but it doesn't actually go to the page?!
the external links that i use are similiar to this format:
http://www.sampleurl.com/x/?s=r&t=u&v=X ... 1&p=000000
so the PHP urlencode is supposed to change the ampersands i assume and pass it on thru the exit.php and refresh to the actual external link.
Hope i haven't confused.