PDA

Click to See Complete Forum and Search --> : Image Dilema


cpradio
Jul 7th, 2002, 09:53 PM
Originally posted by chrisjk
Arien, not sure if these guys are understanding right, or if i'm not or whatever, but all your need to do in PHP is send the image URL to the browser in the HTTP header, like this

$image_url = "http://www.domain.com/image.gif";

// redirect to image
Header("Location: ". $image_url);
That way, the script actually returns an image rather than just plonking a URL into a page, so it could be used in a VBF sig for example. That's how I do it anyway

Here is my code:
<?php
###############################
## Grab and Display the Images ##
###############################
if (isset($type) && isset($id)) {
if ($type == 0) {
header("Location: ../images/".$id.".gif");
} else {
header("Location: ../images/".$id.".jpg");
}
} else {
header("Location: ../images/spacer.gif");
}
?>

My dilema:
I want to force the user to download a different image then what they are seeing on the page. As of right now they get the same image that is shown but are forced to download it as a bmp instead of gif or jpg format. Does anyone know how to go about this? .htaccess maybe?

I only want to do this, because so many people want a good image stealer protection script and this may get me close.
I am using the above at http://devbytes.cpradio.net/ (top header images)

-Matt

scoutt
Jul 8th, 2002, 02:35 PM
ok not sure I understand but let me try.

you say if I goto that page and right click and save the top images it saves it as bmp? so the image that is there is really a jpg or gif, correct?

well hate to break it to you but you idea won't work.

the reason you download it as bmp is because that is a bug in IE.

http://www.htmlforums.com/showthread.php?s=&threadid=13921&highlight=bug

cpradio
Jul 8th, 2002, 02:45 PM
So you are telling me there is no way to have a user download a different file even though they have to run through my script first?

-Matt

scoutt
Jul 8th, 2002, 02:54 PM
if I right click how is that going through your script? the only way would be to make a transparent layer over the image and then if I right click I get that layer instead. which of course could be a spacer.gif for all I know.

cpradio
Jul 8th, 2002, 03:00 PM
the reason you are running through my script is the image is made by:

<img src="images/index.php?id=01&type=0"> so you are forced to run my script which in return provides the image for the page.

-Matt

scoutt
Jul 8th, 2002, 03:08 PM
yes I understand that, but once the image is there how can you make it so the user downloads something else. that is what I'm saying. unless you make it so it shows the image then how will it be different?

did you read that link?

it doesn't matter what the image is, as long as it is ran through a script like what you are doing, then it will give you that untitled and a bmp