Image through Script, How to add variable to URL
<p>I'm sure it's pretty straightforward since someone just solved a similar problem I had. I have a folder full of city images and need users to see the image corresponding to their city. </p>

<p>Right now I'm getting the users location without problem using "geoip_city()" but I don't quite know how to integrate it into the URL of the image. All images have the following format: New York.jpg, Boston.jpg so I just need to make the script put the location before .jpg</p>

<p>This is what I'm trying now:</p>

<pre><code>&lt;img src="blank.png" id="image" &gt;

&lt;script type="text/javascript"&gt;
document.getElementById('image').src = "http://www.chusmix.com/Imagenes/grupos/' + geoip_city() + '.jpg";
&lt;/script&gt;
</code></pre>

<p>I believe I'm just messing with the quotes or something similar. Could anyone tell me what I'm doing wrong? Also this is where I'm testing it: <a href="http://chusmix.com/?page_id=1770" rel="nofollow">http://chusmix.com/?page_id=1770</a></p>

<p>Thanks</p>
