Guest User

Untitled

a guest
Sep 1st, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.31 KB | None | 0 0
  1. Can anyone help me figure out the meaning of this php error message? [closed]
  2. $con = mysql_connect("localhost", "root", '');
  3.  
  4. if (!$con) {
  5. die('Cannot make a connection');
  6. }
  7.  
  8.  
  9. mysql_select_db('yumbox_table', $con) or die('Cannot make a connection');
  10. isset($_POST['user_name'], $_POST['password'], $_POST['user_type']);
  11.  
  12. $data = mysql_query("SELECT *
  13. FROM users
  14. WHERE user_name == ($_POST['user_name'])
  15. AND ($_POST['password'])
  16. AND ($_POST['user_type'])") or die(mysql_error());
  17.  
  18. $info = mysql_fetch_array($data);
  19. $count = mysql_numrows($data);
  20.  
  21. if ($count == 1) {
  22. echo("Success!!");
  23. } else {
  24. echo("BIG FRIGGIN FAILURE!!");
  25. }
  26.  
  27. mysql_close($con);
  28.  
  29. $data = mysql_query("SELECT * from users where user_name == ($_POST['user_name']) and ($_POST['password']) and ($_POST['user_type'])"
  30.  
  31. $user_name = mysql_real_escape_string($_POST['user_name']);
  32. $password = mysql_real_escape_string($_POST['password']);
  33. $user_type = mysql_real_escape_string($_POST['user_type']);
  34. $data = mysql_query("SELECT * FROM users WHERE user_name == '$user_name' AND password == '$password' AND user_type == '$user_type'");
  35.  
  36. if(isset($_POST['user_name'], $_POST['password'], $_POST['user_type'])){
  37. $data = mysql_query("SELECT * from users
  38. where user_name = '".mysql_real_escape_string($_POST['user_name'])."' and
  39. password = '".mysql_real_escape_string($_POST['password'])."' and
  40. user_type = '".mysql_real_escape_string($_POST['user_type'])."' ");
  41.  
  42. if(mysql_numrows($data) == 1) {
  43. $info = mysql_fetch_array($data);
  44. echo("Success!!");
  45. } else {
  46. echo("BIG FRIGGIN FAILURE!!");
  47. }
  48. }
  49. else{
  50. echo "Required Data Missing";
  51. }
  52.  
  53. mysql_close($con);
  54.  
  55. mysql_query("SELECT * from users where user_name == ($_POST['user_name']) and ($_POST['password']) and ($_POST['user_type'])")
  56.  
  57. //do escaping here. See note below.
  58. $username = isset($_POST['user_name']) ? mysql_real_escape($_POST['user_name']) : '';
  59. $pass = isset($_POST['password']) ? mysql_real_escape($_POST['password']) : '';
  60. $type = isset($_POST['user_type']) ? mysql_real_escape($_POST['user_type']) : '';
  61.  
  62. mysql_query("SELECT * from users where user_name = '{$username}' AND password = '{$pass}' AND user_type = '{$type}'")
Add Comment
Please, Sign In to add comment