Jump to content

gd images display on php page? simple??


john_6767

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)?

cheers
Link to comment
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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.