The javascript code below works perfectly in the HTML of my site. It is a geo-target server that shows the city based on the user's IP.
<script src='http://promos.fling.com/geo/txt/location.php?testip='></script>
What I'm trying to do and can not do is to make it work within a link that I want it to be generated according to the person's city. Type:
<a href="http://www.example.net/?q=Belo Horizonte">Belo Horizonte</a>
I tried to make it work in the manner below but the response to the end of the URL, after ?q=
is the code itself. I tried this way:
<a href="http://www.example.net/?q=<script src='http://promos.fling.com/geo/txt/location.php?testip='></script>">Belo Horizonte</a>
I'm a bit lazy on this subject so any solution be it in PHP or javascript would be welcome. Thank you!