I want to login in my site with my code below,
I want to try to login with email and phone number, but it's not working. What is the problem in my code. Can someone check what is the problem in my code?
If I run my code they no showing any problem, But I try to put the message
to show if my code is working properly, But the message "complete" not show. Please someone can tell me what is the problem in my code.
PHP:
<?php
session_start();
include('vendor/inc/config.php');//get configuration file
if(isset($_POST['send']))
{
$u_email=$_POST['u_email'];
$u_phone=($_POST['u_phone']);
$stmt=$mysqli->prepare("SELECT u_email, u_phone, u_id FROM tms_user WHERE u_email=? and u_phone=? ");//sql to log in user
$stmt->bind_param('ss',$u_email,$u_phone);//bind fetched parameters
$stmt->execute();//execute bind
$stmt -> bind_result($u_email,$u_phone,$u_id);//bind result
$rs=$stmt->fetch();
$_SESSION['u_id']=$u_id;//assaign session to admin id
if($rs)
{ //if its sucessfull
//header("location:admin-dashboard.php");
$succ = "complete";
}
else
{
$error = "Access Denied Please Check Your Credentials";
}
}
?>
I want to try to login with email and phone number, but it's not working. What is the problem in my code. Can someone check what is the problem in my code?
If I run my code they no showing any problem, But I try to put the message
PHP:
$succ = "complete";