daily pastebin goal
38%
SHARE
TWEET

Untitled

a guest Jun 29th, 2018 161 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. $username1 = $_POST['user'];
  4. $password2 = $_POST['pass'];
  5. $servername = 'localhost';
  6. $username = 'root';
  7. $password = "";
  8. $db='db_login';
  9.  
  10.  
  11. $con=mysqli_connect('localhost','root','','db_login');
  12.  
  13.  
  14. if($con)
  15.     echo "connected successfully to database".'<br>';
  16. $query = "select * from tbl_users where user_username='".$username1."' && user_password='".$password2."'";
  17. $result=mysqli_query($con,$query);
  18.  
  19. if($result)
  20. echo "Login successfull !!!!<br>welcome   ".$username1;
  21. else
  22.  
  23. echo "login failed";
  24. /*$sql = "INSERT INTO  (firstname, lastname, email)
  25. VALUES ('John', 'Doe', 'john@example.com');";
  26. $sql .= "INSERT INTO MyGuests (firstname, lastname, email)
  27. VALUES ('Mary', 'Moe', 'mary@example.com');";
  28. $sql .= "INSERT INTO MyGuests (firstname, lastname, email)
  29. VALUES ('Julie', 'Dooley', 'julie@example.com')";
  30.  
  31. if ($conn->multi_query($sql) === TRUE) {
  32.     echo "New records created successfully";
  33. } else {
  34.     echo "Error: " . $sql . "<br>" . $conn->error;
  35. }
  36.  
  37. $conn->close();
  38.  
  39. */
  40.  
  41.  
  42. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top