are you trying to make a script that you will host yourself, and then call in your profile/signature on various forums? something like this?
PHP Code:
[i]My signature:[/i] [img]www.mydomain.com/images/signature_image.php[/img]
If so, what you need to match is the domain the request is coming from - maybe $_SERVER['HTTP_REFERER'], but I'm not sure how reliable that would be - not all browsers send that info with their requests.
You might try adding a query string to the image link, something like:
PHP Code:
[img]www.mydomain.com/images/signature_image.php?d=www.example2.org[/img]
and then, in your script:
PHP Code:
<?php
$domain = $_GET['d'];
$images= array('www.example1.com' => 'imgforexample1.png', 'www.example2.org' => 'imageforexample2.png', 'www.example3.net' => 'imageforexample3.png');
$BackgroundImage = isset($images[$domain]) ? imagecreatefrompng($images[$domain]) : /*default image here (if domain not in array)*/;
?>
Or, you could use a numbered array too. That would make your img tags cleaner.
Bookmarks