GetDotted Domains

Viewing Thread:
"Now how would I do this then, eh? EH?"

The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.

Thu 16/12/04 at 22:05
Regular
"Pouch Ape"
Posts: 14,499
I need to stop people being able to type in the URL of an image, but I need to be able to display the image in the HTML/PHP.

Let me explain better.

I don't want this:
http://www.mydomain.com/images/hidden_image.gif

But I want this:


Is it an HTDOCS trick? Can I hide some of the characters from display in the source?

Cheers, mankey_mon
Fri 17/12/04 at 16:28
Regular
"Devil in disguise"
Posts: 3,151
Erm...you don't need GD at all to do this.
All you need is something like ...

$data="";
$fp = fopen("$image_file", "rb");
while(!feof($fp))
{
$data .= fread($fp, 1024);
}
fclose($fp);
header("content-type: image/jpeg");

print $data;
?>

..or something like that.

You only need GD if you intend to alter the image, eg add a water mark.

monkey_man wrote:
> What I'm trying to achieve is a series of images, some private, some
> public, where a user wouldn't be able to simply type the path to the
> image in the browser. I'll have another look at the GD stuff on
> PHP.net again.

The 2nd link I provided you below showed you exactly what you wanted, obviously you don't want to read it though. ;)
Fri 17/12/04 at 16:02
Regular
"Pouch Ape"
Posts: 14,499
I've used the GD libraries before, to map out 3D co-ordinates into solid shapes. It's awesome, in a BBC Turtle kinda way (made one of them at Uni too!). Not sure if it'll help me with this though.

What I'm trying to achieve is a series of images, some private, some public, where a user wouldn't be able to simply type the path to the image in the browser. I'll have another look at the GD stuff on PHP.net again.
Fri 17/12/04 at 15:57
Regular
"bing bang bong"
Posts: 3,040
monkey_man wrote:
> But then couldn't someone right-click and see the path to the image
> still?

The only time I have ever used PHP-GD was in some Uni coursework - you'd use functions within the library to create an image object, alter it dynamically (we drew coloured circles on ours ) and then show that image on the page. I would presume you could load image data from a file somewhere below the root of your site and show that in the same way. I don't know what would happen if the user right-clicked on the image, It might have some kind of temporary file object on the server. Which I guess is still no good, I suppose.
Fri 17/12/04 at 15:52
Regular
"Devil in disguise"
Posts: 3,151
monkey_man wrote:
> But then couldn't someone right-click and see the path to the image
> still?

All they'd see is something like show_image.php?img=xxxx for the link to the image but then you'd be back to checking the referrer to prevent direct linking. The suggestion isn't any different to what Nimco already mentioned.
Fri 17/12/04 at 15:38
Regular
"Pouch Ape"
Posts: 14,499
But then couldn't someone right-click and see the path to the image still?
Fri 17/12/04 at 14:43
Regular
"bing bang bong"
Posts: 3,040
One thing you could do would be to place the images in another directory below the root of your website, and use php or similar to implant them into your website. You might have to use PHP-GD or whatever the image library is called though.
Fri 17/12/04 at 10:50
Regular
"Pouch Ape"
Posts: 14,499
Coin wrote:
> Meh, won't stop people.
>
> PrntScrn and a little paint / photoshop does it all anyway.

That's fine, because I do want certain people to see the images, and they can do what they want with them.
Fri 17/12/04 at 02:22
Regular
"NULL"
Posts: 1,384
I once found a system that was practically impossible to extract the images from. All the usual methods had been prevented - copy & paste, copying image source, etc - plus print screen, image capture programs, etc. The only way to copy the image would be to photograph the monitor.

On another note, you can call your image as image.php?id=xxxxx and use image.php to load the image so they can't tell where the image is coming from. You could even store the images in a database if you wanted.
Fri 17/12/04 at 00:32
Regular
"Bicycle"
Posts: 4,899
Meh, won't stop people.

PrntScrn and a little paint / photoshop does it all anyway.
Fri 17/12/04 at 00:24
Regular
"Devil in disguise"
Posts: 3,151
You're referring to hotlinking I guess. If you're using apache, you really need mod_rewrite enabled to do it though.
Basic tutorial on it [URL]http://www.webmasterstop.com/tutorials/prevent-hotlinking.shtml[/URL]

This [URL]http://www.alistapart.com/articles/hotlinking/[/URL] covers it also, and suggests methods for using PHP as well. Although using PHP is extreme because of the extra load it puts on the server.

Freeola & GetDotted are rated 5 Stars

Check out some of our customer reviews below:

Excellent
Excellent communication, polite and courteous staff - I was dealt with professionally. 10/10
Second to none...
So far the services you provide are second to none. Keep up the good work.
Andy

View More Reviews

Need some help? Give us a call on 01376 55 60 60

Go to Support Centre

It appears you are using an old browser, as such, some parts of the Freeola and Getdotted site will not work as intended. Using the latest version of your browser, or another browser such as Google Chrome, Mozilla Firefox, or Opera will provide a better, safer browsing experience for you.