struktura bazy: userid,email,password,realname
<?php // Connect To The database $dbconx=mysqli_connect("","","","") OR // Fetch User details sent $email=$_POST["email"]; $password=$_POST["password"]; // Check if user input is blank if ($email=="" || $password=="") { } else { // Fetch user details $result = mysqli_query($dbconx,"SELECT * FROM users WHERE email='$email' and password = '$password' LIMIT 1"); if (mysqli_num_rows($result)>0) { // Create Sessions and redirect user to homepage $_SESSION["email"] = $email; } else { } } }