Advertisement
Guest User

Untitled

a guest
Jun 11th, 2017
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.06 KB | None | 0 0
  1. <?php
  2. // Include Database
  3.  
  4. include_once("db.php");
  5.  
  6. // Get Variable's Username / Password from URL
  7. $myusername = $_GET['u'];
  8. $passwordHash = sha1(strip_tags($_GET['p']));
  9. $sender = $_GET['s'];
  10. $whisper = $_GET['w'];
  11. $realm = $_GET['r'];
  12. $charname = $_GET['c'];
  13. $subject = 'New Whisper';
  14.  
  15. // Check that username / Password match database
  16. $sql="SELECT * FROM members WHERE username='$myusername' and password='$passwordHash'";
  17. $rs = mysql_query($sql) or die ("Query failed");
  18.  
  19. // Mysql_num_row is counting table row
  20. $numofrows = mysql_num_rows($rs);
  21. // If result matched $myusername and $mypassword, table row must be 1 row
  22.  
  23. if($numofrows==1){
  24. // Access Granted Begin Whisper update procedure
  25. ECHO 'Access Granted';
  26. // Add the new whisper to the database
  27. //TODO: split login and whispers in db,add the whisper to the char on the realm(aka use the variables above :P)
  28. mysql_query("INSERT INTO messages (reciever, sender, message) VALUES('$myusername', '$sender', '$whisper')") or die (mysql_error());
  29. } else
  30. {
  31. ECHO 'User Does Not Esist';
  32. exit;
  33. }
  34.  
  35.  
  36. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement