Cod: Selectaţi tot
<?php
/**
* Created by JetBrains PhpStorm.
* User: Joshua
* Date: 7/20/12
* Time: 3:36 PM
* To change this template use File | Settings | File Templates.
*/
session_start();
session_regenerate_id(TRUE);
include ('core/config.php');
include ('core/wCrypt_AES.php');
if(isset($_POST['login']))
{
$username = substr($_POST['username'], 0, 15);
$aes = new wCrypt_AES;
$key = "12345";
$password = trim(strip_tags($_POST['password']));
$blowfish = $aes->AESDecrypt($password,$key,256);
$sql = "SELECT * FROM members where username=:username AND password=:password ";
$stmt = $dbconnect->prepare($sql);
$stmt->execute(array(':username' => $username, ':password' => $blowfish));
if($stmt->rowCount() == 1)
{
$_SESSION['on'] = $username;
header('location:index.php');
}
else
{
echo "Error message here...";
}
}
?>
<html>
<head>
<title>MLM - Login</title>
</head>
<body>
<form action="" method="post">
<input type="text" name="username">
<input type="password" name="password">
<input type="submit" name="login" value="Login">
</form>
</body>
</html>
