Advertisement
Guest User

Untitled

a guest
Mar 28th, 2015
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.28 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title>Criminal Empire</title>
  4. </head>
  5.  
  6. <body>
  7. <?
  8. if (isset($_POST['Register'])) {
  9.  
  10. $password = substr(md5($_SERVER['REMOTE_ADDR'].microtime().rand(1,100000)),0,6);
  11. // Generate a random password
  12. }
  13.  
  14.  
  15. ?>
  16. <?
  17. if (isset($_POST['Send'])) {
  18.  
  19. $password = substr(md5($_SERVER['REMOTE_ADDR'].microtime().rand(1,100000)),0,6);
  20. // Generate a random password
  21.  
  22. $nsql = "SELECT * FROM login WHERE mail='".mysql_real_escape_string($_POST['Email'])."'";
  23. $query = mysql_query($nsql) or die(mysql_error());
  24. $row = mysql_fetch_object($query);
  25. $name = htmlspecialchars($row->name);
  26. $pass = htmlspecialchars($row->pass);
  27. $mail = htmlspecialchars($row->email);
  28.  
  29.  
  30.  
  31. if((empty($_POST['Email']))){ // if the email field is empty there will be an error
  32.  
  33. echo 'You one field empty.';
  34. }else{
  35.  
  36.  
  37. if(empty($name)){ if // there is no name with the entered email
  38. echo 'Invalid information.';
  39. }else{
  40.  
  41. if($_POST['Email'] != $mail){
  42. echo 'Invalid information.'; // if their is no match in the email
  43. }else{
  44.  
  45. if(!checkEmail($_POST['Email'])){ // the checkEmail function we have in our function that saves us time and sapce
  46. echo 'Your email is not valid!';
  47. }else{
  48.  
  49. $result = mysql_query("UPDATE users SET password='$password' WHERE name='" .mysql_real_escape_string($name). "'")
  50. or die(mysql_error());
  51.  
  52. $to = $_POST['Email'];
  53. $from = "no-reply@Game.co.uk";
  54. $subject = "Registration - Your Registration Details";
  55.  
  56. $message = "<html>
  57. <body background=\"#4B4B4B\">
  58. <h1>Game Registration Details</h1>
  59. Dear $name, <br>
  60. <center>
  61. Your Username: $name <p>
  62.  
  63. Your Password: $password <p>
  64.  
  65. </body>
  66. </html>";
  67.  
  68. $headers = "From: Game Lost Details <no-reply@Game.co.uk>\r\n";
  69. $headers .= "Content-type: text/html\r\n";
  70.  
  71. mail($to, $subject, $message, $headers);
  72.  
  73. echo 'We sent you an email with your Details!';
  74.  
  75. }
  76. }
  77. }// check if name is unused.
  78. }// check if accepted to the tos.
  79. }// name check.
  80. // if post register.
  81.  
  82. ?>
  83.  
  84.  
  85. <form method="post" >
  86. <center>
  87. <h1><strong>Lost Password</strong></h1>
  88. <p>Email:
  89. <input type="text" name="Email" id="Email">
  90. <br>
  91. <input type="submit" name="Send" id="Send" value="Send">
  92. </p>
  93. </center>
  94. </form>
  95. </body>
  96. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement