Posted by anon@the.net on 10/07/17 11:29
<?php
if(! isset($_POST['username'])) {
header("Location: login.php");
}
mysql_connect(DELETED)
mysql_select_db(DELETED)
$username = $_POST['username'];
$username = mysql_real_escape_string($username);
$result = mysql_query("SELECT userid, pswd FROM users WHERE username = '$username'");
if(mysql_num_rows($result) > 0) {
$row = mysql_fetch_assoc($result);
$userid = $row['userid'];
$pswd = $row['pswd'];
}
$formpswd = $_POST['password'];
$formpswd = md5($formpswd);
if(mysql_num_rows($result) == 0) {
header("Location: login.php");
} else if($pswd == $formpswd) {
session_unset();
session_destroy();
session_start();
$_SESSION['userid'] = $userid;
header("Location: userhome.php");
}
mysql_close();
?>
--
----------------------------------------------
Posted with NewsLeecher v3.0 Final
* Binary Usenet Leeching Made Easy
* http://www.newsleecher.com/?usenet
----------------------------------------------
Navigation:
[Reply to this message]
|