Short Url Help!

'm trying to set up short urls on my page and what I need to do is insert a url from a parent frame page into an input. So on the child iframe I’m using this to pull the refferers url

<?php $url="".$_SERVER['HTTP_REFERER']; echo $url; ?> 

which works great Then I want to insert it in an input on the same page

[code]$site = my_SITE;
echo <<<HTML

Sponsor our Newsletter | Privacy Policy | Terms of Service