Here is a simple and yet effective PHP/MySQL happy medium login. I wrote it back in the day so its been updated and goes through a TON more checks and stuff now.
<?php
if(isset($login)){
include("connection.inc");
$sql = "select * from member_info where username='$username'";
$result = mysql_query($sql);
if (mysql_num_rows($result) < 1) {
// Checks to see if their Username is all good. If not then it goes to the sorry.inc page.
include("sorry.inc");
exit;
}ELSE{
while ($row = mysql_fetch_array($result)) {
$realpassword = $row['password'];
$member_id = $row['member_id'];
}
}
if ($password != $realpassword){
// Sorry.inc is a html page.
include("sorry.inc");
exit;
}ELSE{
// If everything worked out fine.
session_register("member_id");
$date = date("F j, Y, g:i a");
$sql1 = "Update member_info SET last_login='$date' where member_id='$member_id'";
mysql_query($sql1);
include("membermain.inc");
exit;
}
}
// FORM BELOW!
include("login.inc");
?>
So from that you should be able to mix and match a few things so that you can make your own login. Please just give some credit back to Broken Formula LLC somewhere. 😃 Also check out www.brokenformula.com