Question: The goal here is to add one code

The goal here is to add one code

connect_error) { die ("Connection failed: " . $db->connect_error); } //add code here to select * from table User where email = '$email' AND password = '$password' // start with $q = $r = $db->query($q); $row = $r->fetch_assoc(); if($email != $row["email"] && $password != $row["password"]) { $validate = false; } else { $emailMatch = preg_match($reg_Email, $email); if($email == null || $email == "" || $emailMatch == false) { $validate = false; } $pswdLen = strlen($password); $passwordMatch = preg_match($reg_Pswd, $password); if($password == null || $password == "" || $pswdLen < 8 || $passwordMatch == false) { $validate = false; } } if($validate == true) { session_start(); $_SESSION["email"] = $row["email"]; header("Location: index.php"); $db->close(); exit(); } else { $error = "The email/password combination was incorrect. Login failed."; $db->close(); } } ?> 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!