How can i change a code that looks like this: http://www.site.com/bm.php?u=http%3A%2F%2Fwww.digitalpoint.com Code (markup): to look like this: <div> <a href='<?php echo "http://facebook.com/share.php?u=$url"; ?>'> Url'ye git</a></div> Code (markup): I've tried a code that looks like this: <?php $url = urldecode($HTTP_GET_VARS[u]); ?> Code (markup): but i get an error saying: -------- Forbidden You don't have permission to access /bm.php on this server. -------
works ok for me <?php $url = "http://www.site.com/bm.php?u=http%3A%2F%2Fwww.digitalpoint.com"; $url2 = urldecode($url); echo $url."<br>\n"; echo $url2."<br>\n"; ?> PHP:
Forbidden message is result of misconfiguration of your webserver or restriction in .htaccess file. Maybe this helps: <div> <a href='http://facebook.com/share.php?u=<?php echo urlencode($_GET['url']); ?>'> Url'ye git</a></div> PHP: