من این رو نوشتم ولی جواب نمیده
<?php if(isset($_POST['user'], $_POST['pass'])){ $user = dbEscape(strtolower($_POST['user'])); $pass = sha1($_POST['pass']); $user = dbArrayQuery("SELECT * FROM user WHERE (LOWER(user)={$user} AND pass='{$pass}');"); if(count ($user) == 0){ alert('ERROR' , 'Invalid Username or Password.' , 'danger'); }else{ $user = $user[0]; $_SESSION['uid'] = $user['id']; $_SESSION['uname'] = $user['name']; $_SESSION['login'] = true; redirect(); } } ?>
function dbEscape($value){ $con= dbConnect(); return is_null($value) ? 'NULL' : '''. mysqli_real_escape_string ( $con, $value) .'' '; }