/    Sign up×
Community /Pin to ProfileBookmark

secure images

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 [url]www.domain.com/members[/url] ; 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.

to post a comment
Full-stack Developer

7 Comments(s)

Copy linkTweet thisAlerts:
@PeOfEoOct 26.2004 — 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.
Copy linkTweet thisAlerts:
@Bobby_SauthorOct 26.2004 — 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.
Copy linkTweet thisAlerts:
@PeOfEoOct 26.2004 — I don't know about mysql, but I know it can be done with mssql which is what I use.
Copy linkTweet thisAlerts:
@Bobby_SauthorOct 26.2004 — Someone knows in case of a PHP/MySQL website?
Copy linkTweet thisAlerts:
@Robert_WellockOct 26.2004 — Well since they both use SQL then yes it will be possible.
Copy linkTweet thisAlerts:
@Bobby_SauthorNov 17.2004 — 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:
Copy linkTweet thisAlerts:
@Paul_JrNov 17.2004 — 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 [url=http://www.phpbuilder.com/columns/florian19991014.php3]this PHPBuilder.com article[/url].
×

Success!

Help @Bobby_S spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...