cancel
Showing results for 
Search instead for 
Did you mean: 

Password Protecting a Page

N/A

Password Protecting a Page

Hi

I need to set up a form on my index page in which a visitor enters their user name and password to gain access to a protected page. The user names and passwords are stored in a MySQL database.

I am very new to PHP, and script I have cobbled together does it in a very basic and unprofessional looking way.

If someone could tell me the best way of doing this - or point me in the direction of a good script to do it (I have tried a couple so far with little success), I would be very grateful.

Cheers.

Graham@itemuk.com
3 REPLIES
N/A

Password Protecting a Page

I have done that myself, but I used .asp which f9 dont support, a shame because it allows you to use whatever database you like. My forums at www.global-lifeline.co.uk/forum/default.asp are run on an access database, which makes it very easy to backup and repair if things go wrong. As for user Passwords, I have a little script that when a user enters name and passy from a form, it looks in the database to see if it is there, and if it is issues a session cookie which will last until the user closes the browser. This means they can wander round the whole site, protected pages and unprotected pages without having to keep on logging in again (Unlike on this darn forum!!!)
N/A

Password Protecting a Page

RevDaveB: My technique for using "Auto Login" to avoid this problem:[list=1]
  • Log in to the Discussion forums as normal.

  • If there's something of interest, which might mean I want to stay a while (eg writing a reply), click on Connection settings and then choose the "Auto Login" applet.

  • Enter 99 in "Duration"; select "Years" under period; select "On", then press "Go". It should report the AutoLogin has been set.

  • Return to "Discussion forums", and make sure the address shown in the location bar shows as "http: something" not "https: something". If it's "https" delete the "s" and press enter.[/listShocked]Thats's it; it works for me!
  • N/A

    Password Protecting a Page

    Thanks for that! I will know if it worked when I click submit! Smiley