Jackal Posted June 10, 2006 Report Share Posted June 10, 2006 (edited) Nu man ir šitāds login skripts, bet viņš netaisa to otro redirekt uz login.php, ja lietotājs ir ievadijis nepareizu paroli vai lietotājvārdu. Kas tur ir nepareizi? connect(); $username = $_POST['user']; $ip = $_SERVER['REMOTE_ADDR']; mysql_query("UPDATE users SET ip='$ip', online='yes' where `nickname`='$username'");{ $password=$_POST['pass']; $nickname=$_POST['user']; $kom=mysql_query("select `nickname`,`password` from users where `password`='$password' and `nickname`='$nickname'"); while($row=mysql_fetch_array($kom)){ if(isset($_POST['login'])){ session_start(); $username=$row['nickname']; $password=$row['password']; if ($_POST['user'] == $username && $_POST['pass'] == $password){ $_SESSION['logged'] = $_POST['user']; header("Location: index.php"); } else { $_SESSION['logged'] = false; header("Location: login.php"); } } } } ?> Edited June 10, 2006 by Jackal Link to comment Share on other sites More sharing options...
kaszu Posted June 10, 2006 Report Share Posted June 10, 2006 :D $kom=mysql_query("select `nickname`,`password` from users where `password`='$password' and `nickname`='$nickname'"); while($row=mysql_fetch_array($kom)){ ja lietotaja vards un parole buus nepareiza, mysql neatgrieziis nevienu ierakstu, taatad while neizpildiisies. Link to comment Share on other sites More sharing options...
Recommended Posts