- Oct 10, 2015
- 447
- 848
- 208
this is my login script
need help for an bridge that users login and /or register in WBB
Code:
<div id="bottom">
<div id="left">
<div id="panel">
<div class="title">User Area</div>
<div class="body">
<?php
if (!$_SESSION["MM_Username"]) {
print'<br><form method="POST">
<center><input type="text" name="username" placeholder="Username" id="login"><br>
<input type="password" name="password" placeholder="Passwort"><br><br>
<input type="submit" value="Login" name="login" width="100" height="25"/><br><p><br>
<a href="pass_recovery.php">Password vergessen?</a> | <a href="register.php">Registrieren</a></center>';
if ($_POST['login']) {
$username = mysql_real_escape_string($_POST['username']);
$password = mysql_real_escape_string($_POST['password']);
$password = sha1(strtoupper($username) . ":" . strtoupper($password));
$doesExist = mysql_query("SELECT `id` FROM auth.account WHERE username='" . $username . "' && sha_pass_hash='" . $password . "' ");
if (mysql_num_rows($doesExist) == 1) {
setcookie('username', $username, time() + 60 * 60 * 24 * 365);
setcookie('password', $password, time() + 60 * 60 * 24 * 365);
header('Location: ' . $website);
} else {
echo 'Wrong Username / Password!';
}
}
}
need help for an bridge that users login and /or register in WBB