has anyone experience problems passing urls containing the & symbol
I ahve a page that counts clicks.
The url are passed to the page and stored in the db the user is then passed on using the header() function.
When it encounters a url with a & symbol it cuts off anything that follows it eg
www.wherever.com?operate=book&somethingelse=blah
is cut to www.wherever.com?operate=book
ive tried putting the & symbol in other places using test dummy urls and in every instance the outcome is the same in that anything after the & is chopped.
I have tried a number of suggestions from alt.php which included using & in the db to deal with any potential html problems relating to the & symbol
I have tried urlencode, and stripslashes both in the sending and receiving pages and variants of.
The result is aleays the same.
heres the code that sends the url
/*
<a href=\"clicktrack.php?link=http://$row[webadd]\">Visit Website</a>
*/
heres the code that receives
/*
$link=$HTTP_GET_VARS['link'];
if(!$link){
$link="http://www.airport-accommodation.co.uk";
}else{
$query="select count from link_count where url = '$link'";
$result=@($query);
if(@mysql_num_rows($result)>0){
// if the url exists in the database
$data=@mysql_fetch_array($result) ;
$count=$data[0]+1;
$query="update link_count set count = '$count' where url = '$link'";
$result=@($query);
}
else{
// add the url to the database
$query1="insert into link_count values ('$link', '', '')";
$result1=mysql_query($query1);
$query2="UPDATE link_count SET count=count+1 WHERE url=$link" ;
$result2=mysql_query($query2);
}
}
//things tried to see the output
//echo $link= stripslashes($link);
//echo $link= urlencode($link);//
//echo $link= urlencode(stripslashes($link));//
//header("Location: urlencode($link)");
header("Location: $link");
*/