I'm trying to find a way to find the URL of an external HTML document when it embeds an image generated by PHP. So for example I would want the following to happen if these two documents occurred.
<img src="http://otherplace.org/image.php" />
http://otherplace.org/image.php
header('Content-Type: image/gif');
readfile("test.gif");
$thelocation = MAGICAL_COMMAND;
$thelocation = http://example.com/index.html