Click to See Complete Forum and Search --> : secure images


Bobby_S
10-25-2004, 09:54 AM
hi all! :)

imagine the following situation: (no real case situation, just to have a good example)
I have a page xx on a website on which visitors can see 1 image for every product I offer. Members can see 5 images on that same page xx. How can I implement this??
Say:
- members login on www.domain.com/members ; after login a cookie is written which I want to use on that page xx to determine if the visitor is a member or not, and so to determine to display 1 or 5 images.
- the 4 'member-images' should stay secure! and not manually fetchable or by something like TeleportPro

How can I do this please? Thanks in advance.

PeOfEo
10-25-2004, 10:10 PM
I would say store all of the images within a data base annd when you go to display them pull them out with an sql statement. Then use a server side language to access that db and also use the server side language to log the user ina nd identify if the user is logged in. You can use a cookie or a session. Another approach would be to actually log the user into the machine (if there are only a few users) and only give a logged in user permissions to the image.

Bobby_S
10-26-2004, 03:18 AM
thanks for your answer, PeOfEo!
To be honest I didn't know it was possible to put non-text in a MySqlDB, like images.
I'm gonna try that solution.

PeOfEo
10-26-2004, 06:21 AM
I don't know about mysql, but I know it can be done with mssql which is what I use.

Bobby_S
10-26-2004, 08:31 AM
Someone knows in case of a PHP/MySQL website?

Robert Wellock
10-26-2004, 09:16 AM
Well since they both use SQL then yes it will be possible.

Bobby_S
11-17-2004, 04:13 AM
ok, I've checked now, but there is no MySQL field type to contain an image, it seems :(
So the solution of storing the images in the DB is no solution :(
Someone else please? :rolleyes:

Paul Jr
11-17-2004, 06:05 PM
Actually you can. I've never done it myself, but I'm quite sure it can be done. I just did a quick Google search for "storing images mysql", and the first result that turned up was this PHPBuilder.com article (http://www.phpbuilder.com/columns/florian19991014.php3).