Hey
I have a click counter where I pass a URL on the end of a link as a query string, i.e.:
/clicks.php?url=$url
The 'clicks.php' page then gets the url, writes it to a table and then I need it to redirect to the clicked site. My code is below:
$sql="INSERT INTO clicktab VALUES ($url)";
$conn = mysql_connect($db_host,$db_user,$db_pass);
$db = mysql_select_db($db_name,$conn);
$result = mysql_query($sql)
header("location: http://$url");
The problem is that I get a 'Cannot Connect To Server' message. The url goes onto the table fine but has a "%20" tagged on to the end which is altering the url and making it invalid.
Any ideas as to how I can prevent this addition at the end?