I have been given a database whose content I can't modify. Everything has been going fine until I was passing some variables in a URL through a link, and an apostrophe in one of the variables (i.e "Frank's Used Cars") is causing the variables behind it to not be passed.
This is what is currently being passed:
&var1=600&miles=44000&var2=Frank
When it should be like this:
&var2=600&miles=44000&var2=Frank's%20Used%20Cars%20&var3=111111111
As I said the problem is with the apostrophe. I've tried changing the 'dealer' field in my database on PHP myadmin to 'utf8_swedish_ci' and also changed it to this on the MySQL connection collation from 'latin1_swedish_ci'.
Obviously if I take the apostrophe out all is fine and dandy but I can't do this. Any help would be great!
echo"<td>";
echo$row->var1;
echo"</td>";
echo"<td>";
echo$row->var2;
echo"</td>";
echo"<td>";
echo$row->dealer;
echo"</td>";
echo"<td><a href='look.php?price=$row->price&miles=$row->miles&dealer=$row->dealer'>More Info</a>
dynamic url link:
echo"<td>";
$url="look.php?make=".urlencode($row->make)."&model=".urlencode($row->model)."&colour=".urlencode($row->colour)."&Reg=".urlencode($row->Reg)."&miles=".urlencode($row->miles)."&price=".urlencode($row->price)."®ion=".urlencode($row->region)."&miles=".urlencode($row->miles);
echo"$urlHTML=htmlspecialchars($url)";
echo "<a href=\"$urlHTML\">More Info</a>";
echo"</td>";