mysql - Mysqli and php login script -


this question has answer here:

i've little problem login script , can't see problem is. entire script mysql connection posted below:

 error_reporting(e_all ^e_notice ^e_warning);  $connection = mysqli_connect("localhost", "root", "");  $db = mysqli_select_db("evaluatori", $connection); 

and login script

include 'config/db-connect-login.php';  session_start(); // starting session  $error = ''; // variable store error message  if (isset($_post['submit'])) {     if (empty($_post['register_email']) ||     empty($_post['register_password'])) {         $error = "email-ul sau parola introduse nu sunt corecte.";     } else {         // define $email , $password         $register_email = $_post['register_email'];         $register_password = $_post['register_password'];         // protect mysql injection security purpose         $register_email = stripslashes($register_email);         $register_password = stripslashes($register_password);         $register_email = mysqli_real_escape_string($register_email);         $register_password = mysqli_real_escape_string($register_password);         // sql query fetch information of registerd users , finds user match.         $query = mysqli_query("select * evaluatori_users (register_password='$register_password' , register_email='$register_email') , register_activation null", $connection);         $rows = mysqli_num_rows($query);         if ($rows == 1) {             $_session['login_user'] = $register_email; // initializing session             $success = '<div class="alert alert-success" role="alert"><i class="fa fa-spinner fa-spin"></i> v-ati autentificat cu success! asteptati 3 secunde.</div></script><meta http-equiv="refresh" content="3; url=profile.php">';         } else {             $error = '<div class="alert alert-danger" role="alert">email-ul sau parola introduse nu sunt corecte.</div>';         }     } }  mysqli_close($connection); 

you didn't give lot of information.

but try this:

replace

 $query = mysqli_query("select * evaluatori_users (register_password='$register_password' , register_email='$register_email') , register_activation null", $connection); 

with this:

 $query = mysqli_query("select * evaluatori_users (register_password='$register_password' , register_email='$register_email') , register_activation null", $connection) or die(mysqli_error($connection)); 

this should show detailed error message. there should easier solve.

edit

maybe problem higher.

replace

$connection = mysqli_connect("localhost", "root", ""); $db = mysqli_select_db("evaluatori", $connection);

with

$connection = mysqli_connect("localhost", "root", "") or die(mysqli_error($connection)); $db = mysqli_select_db("evaluatori", $connection) or die(mysqli_error($connection));


Comments

Popular posts from this blog

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

1111. appearing after print sequence - php -

android - How to create dynamically Fragment pager adapter -