Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include "newdb.php";
- $dbcon=connect_db();
- ?>
- <?php
- SESSION_START();
- ?>
- <?php
- $username=$_GET["username"];
- $password=$_GET["password"];
- $flag=0;
- $statement="SELECT userid FROM users where username='$username' and password='$password'";
- //echo $statement;
- //exit();
- $result=mysqli_query($dbcon,$statement);
- while($row=mysqli_fetch_array($result) )
- {
- $flag=1;
- }
- close_db();
- if($flag==1)
- {
- $myObj=new \stdClass();
- $myObj->result = "ok";
- $myJSON = json_encode($myObj);
- echo $myJSON;
- exit();
- }
- else
- {
- $myObj=new \stdClass();
- $myObj->result = "ko";
- $myJSON = json_encode($myObj);
- echo $myJSON;
- exit();
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement