SHARE
TWEET

Untitled

a guest Jun 14th, 2017 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. $username = $_POST["username"];
  4. $password = $_POST["password"];
  5.  
  6. if (username&&password) {
  7.  
  8. $connect = mysql_connect("localhost","oxyzero","***") or die("Erro");
  9. $db = mysql_select_db("users") or die("Erro 2");
  10.  
  11. $query = mysql_query("SELECT * FROM users WHERE username='$username'");
  12.  
  13. $numrow = mysql_num_rows($query);
  14.  
  15. if ($numrow!=0){
  16.  
  17.  while ($row = mysql_fetch_assoc($query)){
  18.  
  19.    $dbusername = $row['username'];
  20.    $dbpassword = $row['password'];
  21.  
  22.  }
  23.  
  24.  // Se os dados coincidirem:
  25.  
  26.  if ($username==$dbusername&&$password==$dbpassword){
  27.  
  28.  echo "Bem-vindo :D";
  29.  
  30.  }else{
  31.  echo "User incorecto, ou password incoreta.";
  32.  }
  33.  
  34. }else{
  35. die("Esse user não existe!");
  36. }
  37. }else{
  38. die("Insere nome e a password");
  39. }
  40.  
  41. ?>
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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top