|
Posted by Gordon Burditt on 11/28/05 18:32
>I wanna publish a script on my site which allows me to hide image
>source.
>i have rough idea abt it. i`ll point src to some php page like:
><img src="image.php">
>& in tht php wat exactly shud be done so tht user doesnt come to know
>the real source location of image file upon clicking its properties.
>I've seen websites doing this. can somebody post the script for it?
If you want to display an image, the browser has to have a way of
getting it. Unfortunately, this means that the browser has a way
of getting it, which you don't seem to want.
It is possible to have a PHP script return an image. This does
*NOT* hide the location of the image (from the point of view of the
browser, the script *is* an image, and it can fetch it using that
URL), but it does allow the PHP to check whether the user is logged
in and authorized to access it before sending it. A PHP page could,
for example, after checking that the user is logged in, call
header("Content-type: image/jpeg"), fopen() a .jpeg file outside
the document tree, and feed it to fpassthru() to send it on to the
browser. Don't add any text; it will mess up the image.
There is still a URL the browser can use to fetch the image: your
PHP script. But you get to check for a valid login.
Gordon L. Burditt
Navigation:
[Reply to this message]
|