Пример авторизации на PHP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
if (isset($_POST['doc-login'])){ $user_name =$_POST['username']; $password=$_POST['password']; $query="SELECT * FROM doc_logindb WHERE username='$user_name' AND password='$password'"; $result=mysqli_query($con,$query); if (mysqli_num_rows($result)==1){ $_SESSION['username']=$user_name; header("Location:docsPanel.php"); }else{ header("Location:error.php"); } } |