PHP problem: Please help!

I want to generate a code that will allow to site regesterd user to access the image(certificate like Autharized). But in case any other member copy past the code on another unregistered domain so image will not disply… plz help how i could do this??
For example the image of GeoTrus image

The authority site records the domains of authorized sites in their database.

The image points to a script on their server, not a static image file.

That script checks if the domain in the HTTP referrer header ($_SERVER[‘HTTP_REFERER’]) is in their database of authorized domains.

If so, it sends the appropriate content-type header then the image data. If not, it can send nothing to show no image on the unauthorized page.