Re: Loading Images
| From: | Rouvas Stathis | Date: | Thu, 28 Mar 2002 21:19:47 +0000 |
| Subject: | Re: Loading Images | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-90593@lists.php.net to get a copy of this message | ||
As long as preventing users to download a picture you display, my .02Eu
opinion is that is is a fruitless task. A determined user will _always_
find a way to store the picture you send him. After all, you do send
data to him, therefore the data can be manipulated at will:-)
As far as some code to do it, see attached souce.
In the attached source, modify directories as needed.
Invoke with : php -q gif2function.php > test.php
Then point your browser to test.php.
warning: Select a dir with few images. If yopu want to know what happens
when you overdo it, goto
<URL:http://helios.mm.di.uoa.gr/~rouvas/giflib.php>
to see what happened
to me!
tested only on linux.
Kevin Stone wrote:
>
> Huh.. hmm.. maybe this is possible after all. I'll have to test that
> out when I get home. If it works it could sure save me a headache or
> two.
>
> By the way most counters/trackers that I've seen are just simple
> javascripts which gather the browser information then request a tiny
> image from the server with the information in the URL string. This all
> goes into the server's standard log file. Then to count the hit the
> server just reads the log file and parses out the values in the URL
> string. But I guess it's the same basic principle.
>
> -Kevin
>
> -----Original Message-----
> From: Justin French [mailto:justin@indent.com.au]
> Sent: Tuesday, March 26, 2002 5:24 PM
> To: php
> Subject: Re: [PHP] Loading Images
>
> Ummmm, is that correct?
>
> I thought (although never tried) that you could reference an image as
>
> <IMG SRC="image.php?id=3"> or simular, in which case the headers and
> everything else CAN be sent in the image tag, which is embeded in a HTML
> page -- isn't that how they do counters etc etc??
>
> At the moment, I'm just storing my images in my file system, and storing
> the
> URLs in my database (as discussed by someone else in this thread), which
> works fine, as long as nobody deletes the image without deleting the URL
> from the DB.
>
> On the topic of preventing users from saving images, the attempts are
> futile, because they can also just look at your source to DL the image
> from
> it's URL.
>
> One thing I have seen work instead of disabling right-click is to have a
> clear layer (DIV) above the whole page, which (for me) prevents me from
> selecting text + images from below. Although I don't know how reliable
> this
> is.
>
> Justin French
> ---------------------
> http://indent.com.au
> http://soundpimps.com
> ---------------------
>
> on 27/03/02 10:16 AM, Kevin Stone (kevin@helpelf.com) wrote:
>
> > It is quite easy to store images in a database and display them on the
> > screen. You can find tutorials about this online (sorry I don't have
> > any direct links). There are also numerous FREE scripts pre-written
> > that you can integrate into your site, or use to learn how to do this
> > yourself.
> >
> > There is a catch however... and that is you will not be able to
> display
> > anything else along with those images because special content headers
> > must be sent to let the browser know what kind of data it's receiving.
> > Is it a JPEG, GIF or PNG? If the headers are not sent, or the wrong
> > headers are sent, the image will either not display or the user will
> see
> > endless rows of junk text spewed onto the screen (the binary data in
> > ASCII form!!).
> >
> > So this method will only work if you want to display the images in a
> > frame, one at a time, and by them selves. You won't be able to
> > intermingle HTML so forget about doing dynamic menus with this method.
> >
> > The way these dynamic sites work is by storing the paths to each image
> > in the database rather than the images themselves... so you're back to
> > the file system solution.
> >
> > Anyway I hope this helps answer some of the questions you were having
> > about this method. :)
> >
> > -Kevin
> >
> > -----Original Message-----
> > From: Omland Christopher m [mailto:Christopher.Omland@Colorado.EDU]
> > Sent: Tuesday, March 26, 2002 2:45 PM
> > To: heinisch@creaction.de
> > Cc: php-general@lists.php.net
> > Subject: Re: [PHP] Loading Images
> >
> > I wasn't so much concearned about security of users grabbin pics. I am
> > more trying to learn how these people load there menus dynamically and
> > pics dynamically. Do you have any links to pages or code that describe
> > how
> > to make a link in the db to pics on my filesystem?
> > Thanks.
> > -Chris
> >
> > On Tue, 26 Mar 2002 heinisch@creaction.de wrote:
> >
> >> At 26.03.2002 12:47, you wrote:
> >>>
> >>> I don't have any code for this, but I'm hoping someone can point me
> > in the
> >>> right direction. I want to load images or navigation menus
> > dynamically. Is
> >>> it possible to build a database of images and then use php to
> display
> >>> them? Or something along these lines. I know this must be possible,
> >>> becuase I see sites that do something like this, and I cant seem to
> > right
> >>> click the image and save it. Does this make any sense?
> >>> Thanks.
> >>> -Chris
> >> Storing images in a db is not a good idea. instead store them
> >> in your filesystem an have a reference to them in your db.
> >> Then you can make everything ;-)
> >>
> >> Even there΄s no real security for grabbing pics. If your client can
> > see them,
> >> they are on his/her machine. To prevent the right-click, you have to
> > use
> >> JavaScript, but that only works, if the user has it switched on.
> >> A little more secure is putting the pics in flash-movies. But I think
> > there are
> >> already programs out, which allow to extract pictures and
> componenets.
> >> HTH Oliver
> >>