Advertisement
Guest User

Untitled

a guest
Jul 9th, 2017
737
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. <?php
  2.  
  3. // print
  4. //generates and prints a random number between on and one million
  5.  
  6. $email_from= $_GET['email_from'];
  7. $subject = $_GET['subject'];
  8. $message = $_GET['message'];
  9. $user = $_GET['user'];
  10.  
  11. $con = mysql_connect("mysql4.000webhost.com", "a7212342_gm", "password1234");
  12. if(!$con)
  13. {
  14. echo("Server Connection Failure!");
  15. die;
  16. }
  17. else
  18. {
  19. mysql_select_db(a7212342_gm);
  20.  
  21. $randnum = rand(1, 1000000);
  22. $command = "UPDATE users SET Password='" . $randnum . "' WHERE Username='" . $user . "'";
  23. mysql_query(stripslashes($command)) or die(mysql_error());
  24.  
  25. $query = "SELECT Email, Password FROM users WHERE Username='" . $user . "'";
  26. $result = mysql_query($query) or die(mysql_error());
  27.  
  28. while ($row = mysql_fetch_assoc($result)) {
  29. // echo $row["Email"];
  30. // mail( $row["Email"], "Subject: " . $subject, $message . "\r\nNew Password: " . $row["Password"], "\r\nFrom: $email_from" );
  31. mail( $row["Email"], "Subject: " . $subject, $message . "\r\nNew Password: " . $row["Password"], "From: admin@downloadmanager.sourcemegamod.co.cc" );
  32. }
  33. mysql_free_result($result);
  34.  
  35. $command2 = "UPDATE users SET Password='" . MD5($randnum) . "' WHERE Username='" . $user . "'";
  36. mysql_query(stripslashes($command2)) or die(mysql_error());
  37. }
  38.  
  39. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement