Created
August 23, 2016 10:45
-
-
Save JimboFromLimbo/48647bfe21d97725de4b38e28d4bfcf7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
function dbconnect_lowlevel() | |
{ global $dbname,$dbuser,$dbpass,$db, $conn; | |
$db = mysql_connect("localhost",$dbuser,$dbpass); | |
$conn = new mysqli("localhost", $dbuser, $dbpass, $dbname); | |
mysql_query("use $dbname",$db); | |
} | |
session_start(); | |
if (!isset($_POST['user_login'], $_POST['passwrd'])) | |
{ | |
echo "string"; 'Please enter a valid username or password' | |
} | |
dbconnect_lowlevel(); | |
function login(){ | |
$username = $_POST['username'] | |
$password = $_POST['password'] | |
$query = 'select id, user_login, user_email, password from wp_users where user_login = ?'; | |
$types = 's'; | |
$params = array($username); | |
$results = SafeQuery($query, $types, $params); | |
if ($results){ | |
$salt = sha1(md5($password)); | |
$encrypted_password = md5(md5($password).$salt); | |
if ($encrypted_password == $results[0]['password']) | |
{ | |
echo 'string', 'YES'; | |
} | |
else | |
{ | |
return "you suck" | |
} | |
} | |
} | |
die("<pre>" . print_r($results, true) . "</pre>"); | |
// function dbconnect() | |
// { // Connect to the database | |
// if (!isset($_SESSION['userid'])) | |
// { echo "<script type=\"text/javascript\">parent.location.href=\"index.htm\";\n</script>\n"; | |
// // redirect("index.htm"); | |
// die(""); | |
// } | |
// dbconnect_lowlevel(); | |
// } | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment