PDA

View Full Version : Help finding a php/mysql login script


cra992
05-29-2005, 10:50 PM
Hey...
i need some help finding an easy to understand...if there is one...php/mysql login script that actually works...
like a script that you can login,logout,and signup for an account
please help
thanks
charlie :)

Coastal Web
05-29-2005, 10:55 PM
I've had good luck with these:

http://www.free2code.net/plugins/articles/read.php?id=99

or:

http://www.evolt.org/article/PHP_Login_Script_with_Remember_Me_Feature/17/60265/

I've used these skeletons for many'a scripts..

Samantha Gram.

delinear
05-29-2005, 10:57 PM
Have you google (http://www.google.com/search?hl=en&q=php+mysql+login+script)'d? There are literally thousands of ready made login scripts.

As for easy to understand, well, that's different as it depends how complex you want the script to be and what your level of knowledge is but by far the best way to understand any script is to write your own, and if you want help with that, well that's what we're here for.

trancedm
05-29-2005, 11:03 PM
try below link from hotscripts.com

http://www.hotscripts.com/PHP/Scripts_and_Programs/User_Authentication/index.html

cra992
05-30-2005, 02:30 PM
thanks
but the script from evolt.com - the one below
http://www.evolt.org/article/PHP_Login_Script_with_Remember_Me_Feature/17/60265/
how do you make it protect a page...like is there a script that you put at the top of each page and if the person is not logged in there is a login form and if they are logged in it shows the page
please help
thanks
charlie :)

Fou-Lu
05-30-2005, 03:31 PM
Assuming that your login is working correctly, you now have populated your $_SESSION variables. So, since you just need the user to login, you can simply validate your pages with:

if (empty($_SESSION['reguname']) OR !isset($_SESSION['reguname']))
{
include('file.php'); // Include file which prompts them to login
exit;
}
else
{
/* Code for the rest of your page.
With this layout as well, you don't need to use the else statement.
You can simply continue with your code as the lack of username has been restricted and exited.*/
}

cra992
05-30-2005, 03:59 PM
thanks...
but theres another question...how do you use the script below
http://pear.php.net/package/Auth
please help (again)
thanks
charlie :)

cra992
05-30-2005, 05:48 PM
ok...ive decided not to use pear...so im back to the beginning...
i would like to know what php/mysql password protection scripts work best and have a login page, signup page, and a logout page

thanks
charlie :)