I'm looking for help on building a script that will allow users to lock pictures that they have uploaded to my site. Once an image is locked, it isn't viewable by anyone unless they have the password (which is set when the image is locked) to unlock the image.
Anyone have some ideas on how to go about this or a site that has code similar to this that could help me out?
Thanks in advance!
Image Lock Script
Moderator: General Moderators
-
fractalvibes
- Forum Contributor
- Posts: 335
- Joined: Thu Sep 26, 2002 6:14 pm
- Location: Waco, Texas
-
curseofthe8ball
- Forum Commoner
- Posts: 73
- Joined: Sun Jun 01, 2003 12:33 am
The image filename is stored in the database currently. The PHP script tells it the path for the images directory and pulls the images based on filename.
What I'm trying to provide my users is the following:
They log into the site and goto their "Manage Photo Album" page. I'd like them to be able to password-protect any image(s) they feel necessary. This could be done via a text box underneath each image, for example.
If an image is password-protected it would display a generic graphic (something with a lock on it which I will create) to the general public. For the general public to be able to view the image, they would need the password to type into the box underneath the locked image. This would "unlock" the image.
Does this better explain what I'm looking to do? Ask any questions you need to better help me! Thanks,
What I'm trying to provide my users is the following:
They log into the site and goto their "Manage Photo Album" page. I'd like them to be able to password-protect any image(s) they feel necessary. This could be done via a text box underneath each image, for example.
If an image is password-protected it would display a generic graphic (something with a lock on it which I will create) to the general public. For the general public to be able to view the image, they would need the password to type into the box underneath the locked image. This would "unlock" the image.
Does this better explain what I'm looking to do? Ask any questions you need to better help me! Thanks,
If, as mentioned above, you add a column "locked_status" (0 or 1) and "password" try something approximately like this:
Code: Select all
<?php
// query db for image data..
IF ($locked == 0 OR $_POST['password'] == $password) {
echo '<img src="..etc..">';
} ELSE {
// display the form, locked image etc
}
?>