when i click on a link generated using variables i get ascii charactors instead of a litteral URL
example
i click a link that shows a path of "mydomain.com/dir/dir/file.ext"
and it takes me to mydomain.com%2Fdir%2Fdir%2Ffile.ext
here is my code for building the link
<?
$url = 'dir/dir/file.ext';
$var = '1';
?>
<html>
<head>
</head>
<body>
<a href="<?=urlencode($url)?>">
<?= $var?></a>
</body>
</html>
do i need to format the string somehow before using $urlencode in this manner?