
Originally Posted by
Chris Z
current PHP version (5.2.0)
IN actuality's terms, the 'current' PHP version is '5.2.1'. '5.2.0' is outdated with over 60 major security flaws fixed from '5.2.0' to '5.2.1', not including the minor ones, which could be in the thousands.
PHP Code:
<?php
/*
_____ _____ _____ _____ _ _____ _____ _ __ _ _____
| _ \ / ___/ / ___| | _ \ | | | _ \ |_ _| | | | \ | | / ___|
| |_| | | |___ | | | |_| | | | | |_| | | | | | | \| | | |
| _ { \___ \ | | | _ / | | | ___/ | | | | | |\ | | | _
| |_| | ___| | | |___ | | \ \ | | | | | | | | | | \ | | |_| |
|_____/ /_____/ \_____| |_| \_\ |_| |_| |_| |_| |_| \_| \_____/
(c)2007 BScripting Inc. All RIghts Reserved.
No data from this script may be used in other scripts without permisson from the create, Brandon Long
Created by Brandon Long <brandon@blnetworks.net>, President and Lead Developer of BScripting
*/
// Start the session
session_start();
// Include your config file
include '';
if (isset($_POST['submit'])) {
if ($_POST['username'] != '') {
if ($_POST['password'] != '') {
$username = $_POST['username'];
$password = md5($_POST['password']);
$getdata = mysql_query("SELECT * from `users` WHERE `username`='$username' LIMIT 0,1");
$QueryDB3 = mysql_fetch_array($getdata);
if ($QueryDB3['password'] == $password) {
// The user has loggedin:-)
$_SESSION['username'] = $username;
$_SESSION['password'] = $password;
header("Location: "); // Enter red URL here
}else{ header("Location: login.php?error=1"); } // Wrong Password
}else{ header("Location: login.php?error=2"); } // Never entered password
}else{ header("Location: login.php?error=3"); } // Never entered username
}else{ // Never subbmitted the form
// LOGIN SCRIPT HERE.
/*
Please put the login script here. Include the following snipplet at the bottom
*/
/*
if (isset($_GET['error'])) {
if ($_GET['error'] == 1) { echo '<font color="red">Incorrect Password</font>'; }
elseif ($_GET['error'] == 2) { echo '<font color="red">Please enter a password</font>'; }
elseif ($_GET['error'] == 3) { echo '<font color="red">Please enter a username</font>'; }
}
*/
/* FORM VARB's
username 'name' attribute should be 'username'
password 'name' attribute should be 'password'
Login button 'name' attribute should be 'submit'
*/
} // end else
/*
END OF FILE
*/
?>