Quote:
|
Originally Posted by plutonium83
I'm currently making a website for Team639 and i'm looking for a secure login script. The script can be in any language, but PHP is preferred(since I understand it). The script must have the following criteria:
- server/user "talk" (especially with usernames and passwords) must be encrypted.
- database driven
- admin panel
- users can modify their data (Name, phone #, etc)
Thanks!
|
I would recommend
http://www.phpnuke.org,
Creating one isn't too bad. It's good experience to learn.
Ex: user/login system
Code:
session_start(); // top of each page
// have a check from form post to post user/pass into a certain variable
// lets say $user, $pass it will store it into from the form variable $frm_user and $frm_pass
// next register these variables as session_variables
session_register("user", "pass");
//verify with database
$con = mysql_connect("host", "user", "pass");
//might want to add a crypt function in between for secure passwords
$result = mysql_query("SELECT from BLA where user='$user' AND pass='$pass'");
if ($row)
{
$row = mysql_fetch_assoc($result);
extract($row);
echo $user . "successfully logged in.";
}
else
{
//user denied
}
mysql_close($con);
It's just a sample, I made it up in less than a minute so there might be minute errors.