|
-
Jul 7th, 2002, 09:53 PM
#1
Thread Starter
Fanatic Member
Image Dilema
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
PHP Code:
$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 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
-
Jul 8th, 2002, 02:35 PM
#2
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...&highlight=bug
-
Jul 8th, 2002, 02:45 PM
#3
Thread Starter
Fanatic Member
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
-
Jul 8th, 2002, 02:54 PM
#4
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.
-
Jul 8th, 2002, 03:00 PM
#5
Thread Starter
Fanatic Member
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
-
Jul 8th, 2002, 03:08 PM
#6
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|