Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include 'config.php';
- // Creating connection.
- $con = new mysqli($dbhost, $dbusername, $dbpassword, $dbname);
- $json = file_get_contents('php://input');
- $obj = json_decode($json,true);
- $email = $obj['email'];
- $password = $obj['password'];
- $Sql_Query = "select * from users where email = '$email' and password = '$password' ";
- // Executing SQL Query.
- $check = mysqli_fetch_array(mysqli_query($con,$Sql_Query));
- if(isset($check)){
- $SuccessLoginMsg = 'Data Matched';
- $SuccessLoginJson = json_encode($SuccessLoginMsg);
- echo $SuccessLoginJson ;
- }
- else{
- $InvalidMSG = 'Invalid Username or Password Please Try Again' ;
- $InvalidMSGJSon = json_encode($InvalidMSG);
- echo $InvalidMSGJSon ;
- }
- mysqli_close($con);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement