This is a discussion on "passwords" within the PHP Forum section. This forum, and the thread "passwords are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
passwords
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
passwords
Hi,
I have created a online photo album, is it possible for me to password this??? I know you can password html files, but i dont know how to / if you can password photo albums and such. Hope someone will be able to help. Cheers Simon |
|
|
|
|||
|
Re: passwords
Thanks,
My web host will let me use PHP, so i think thats probably the best option, so any help is appresiated on this. Cheers Simon |
|
||||
|
Re: passwords
Have a look at Joe2torials' PHP section ... there's a few good scripts in there as well as an Admin section one.
|
|
|||
|
Re: passwords
You need to look into the following to begin your journey towards php membership / password systems.
Research; Basic php syntax PhP Sessions The : $_POST['']; variable The : $_GET['']; variable Learn how to use phpmyadmin Understand how MySql works. Php If else statements. once you understand that load... this next bit will make sense lol (this is a really basic, ultra fast guide) 1) create a database called "users" 2) Create 1 table and call it "details" 3) within this table create 2 fields "username" & "pasword" now..... thats the database setup.... sounds easy right? ... it is kinda :P Now, you need to decide if you want to allow people to register with your site... or if you want to personally controll the users. If you want total controll, then you should add the usernames and passwords to the database manually in phpmyadmin. Assuming you want to allow registration, your going to need a registration form. Ostensibly a registration form is just an html form that posts to a php script. once the php script (aduser.php) recives the desired username and password in the form of; $username = $_POST['username']; and $password = $_POST['password']; you can begin adding the info to the database.... you need to look into sql queries here and how to use them inside php. Id also suggest encrypting the password before storing it... use md5($password); for this. tehers lots of things you can add, like two password fields and a check to make sure they match etc etc. But once yourve got a registration form that adds users to your database you really need to start looking at php sessions, and start creating a log in form. The log in form is again a html form that posts to a php script. The php script checks to see if the username exists in the database, and then chcks to see if the password entered is the same as the password referenced by the username in the database. Assuming these checks are passed, your script will start what is known as a php session, this will keep the user logged in as they move around the varous pages of your site. |
|
|||
|
Re: passwords
Hey i know a way but do you want a Login and password box?
or Just Password cause if you just want a password then if you have hosting you can use the "WEBPROTECT" addon that comes with most hosting companies. It will password protect a folder i not sure if it will protect certain files if it doesnt then all you do is transfer all you photoalbum files to a new folder called photoalbum then use the "WEBPROTECT" to password protect that folder and then the photo album will be password protected. But up to you and also you can do it in php like Accurax said and Karinne but up 2 you and cause your a beginner the easiest way for you to do this is "WEBPROTECT" but its your site so up to you how you want it dispalyed Hope this Helps you for what you wanted? Thanks Aaron |
![]() |
| Tags |
| passwords |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Encrypting passwords - 2 way or 1 way? | djeyewater | PHP Forum | 3 | Mar 30th, 2008 16:09 |
| md5 passwords | scottw | PHP Forum | 2 | Jan 14th, 2007 15:07 |
| change admin passwords? | swiftmed | PHP Forum | 4 | May 23rd, 2006 12:34 |
| Passwords on pages | phil19 | Hosting & Domains | 9 | Mar 25th, 2006 08:32 |
| databases, usernames and passwords.. | benbacardi | Classic ASP | 3 | Aug 11th, 2004 20:03 |