Advertisement
Guest User

Untitled

a guest
Jun 11th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.90 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. $subject = 'New Whisper';
  12.  
  13. // Check that username / Password match database
  14. $sql="SELECT * FROM members WHERE username='$myusername' and password='$passwordHash'";
  15. $rs = mysql_query($sql) or die ("Query failed");
  16.  
  17. // Mysql_num_row is counting table row
  18. $numofrows = mysql_num_rows($rs);
  19. // If result matched $myusername and $mypassword, table row must be 1 row
  20.  
  21. if($numofrows==1){
  22. // Access Granted Begin Whisper update procedure
  23. ECHO 'Access Granted';
  24. // Add the new whisper to the database
  25. mysql_query("INSERT INTO messages (reciever, sender, message) VALUES('$myusername', '$sender', '$whisper')") or die (mysql_error());
  26. } else
  27. {
  28. ECHO 'User Dose Not Esist';
  29. exit;
  30. }
  31.  
  32.  
  33. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement