Jump to content


This topic is now archived and is closed to further replies.


gd images display on php page? simple??

Recommended Posts

ok, i have what i think is a simple question, excuse my primative php knowledge, lease let me know if i have stated things that don't seem to make sense so i can learn!

how do i display my images i made with gd library page in a normal php page?

i can display them as a php page themselves, but how do i include the php image (its a page that makes an image..) into one of my normal php pages.. do i use includes?

I am doing this so that people cannot see my uploaded images, instead they see my gd library generated image that is the normal image with a watermark over the top..

also what can i do to stop people from viewing my uploaded image directly (hence the image without a watermark)?


Share this post

Link to post
Share on other sites
you just need to use the standard <img src="image.php"> tag on your "plain" php page. as far as I know, you can't "include" actual jpeg data on an HTML page -- although you can attach it to an HTML email.

How do you keep them from seeing your original? keep it in a weird directory someplace else and have the PHP open it from there. Really paranoid? put it in a directory outside your site's root directory and revise your open_basedir to include it...

for example... your site is on the server at /var/www/example.com/httpdocs -- you could put your images in the /var/www/example.com/secretimagesfolder. Nobody should be able to get to it with a standard web browser, but you would likely get open_basedir errors if you didn't update that setting.

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.