How might I go about getting the URL of a website that is looking at an image? I want to make my own pagerank images but want it to pick up the site thats linking in instead of passing it as an argument. A good example would be iWebtools pagerank images. All you would do is place this code on your page and it picks up what URL its coming from: <a href="http://www.iwebtool.com/webmasters/pagerank_button/" target="_blank"><img alt="PageRank Button" src="http://www.iwebtool.com/images/pagerank_numimage.png" border="0"></a> Code (markup): So far I have a PHP script that gets me the number, then I convert it to an image with PHP. Then I have an .htaccess entry to allow me to link to an image, when in fact its redirected to the PHP file. I've tried HTTP_REFERER and other $_SERVER settings but nothing worked. Suggestions?
Why don't you use GD library to dynamically generate the image that it's linked to and that way you could use the script to store the site that's linking to it in a text file or DB. Also it wouldn't be the referer, it would be either $REMOTE_ADDR or $REMOTE_HOST or somethign along those lines...
im using the PHP script to dynamically create the image. after getting the pagerank number, i pass it to the PHP script for making images, starting with header("Content-type: image/gif");