Advertisement
Guest User

Untitled

a guest
May 12th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. /// Login.php
  2.  
  3. <?
  4. include('config.php');
  5.  
  6. if ( $_POST["username"] != "" && $_POST["password"] != "" && $_POST["world"] != "" ) {
  7. login($_POST["username"],$_POST["password"],$_POST["world"]);
  8. }
  9. else
  10. {
  11. echo "Error: Not all feilds entered";
  12. }
  13.  
  14. function login($username,$password,$world) {
  15. $query = "SELECT * FROM ogw_users WHERE username='$username' and password='$password' and world='$world'";
  16. $result = mysql_query($query);
  17.  
  18. while($row = mysql_fetch_assoc($result)) {
  19. $username = $row["username"];
  20. $email = $row["email"];
  21. $world = $row["world"];
  22. }
  23. ?>
  24. <script>
  25. document.cookie = "username=<? echo $username; ?>; password=<? echo $password; ?>;world=<? echo $world ?>;";
  26. window.location.href = "user.php";
  27. <script>
  28. <?
  29. }
  30.  
  31.  
  32. //////////////////////////////////
  33.  
  34. THE ERoor I got is:
  35.  
  36.  
  37. PHP Error Message
  38.  
  39. Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/a4986921/public_html/login.php on line 16
  40.  
  41. Free Web Hosting
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement