Advertisement
Guest User

Untitled

a guest
May 31st, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.19 KB | None | 0 0
  1. <?php
  2.  
  3. require 'global.php';
  4.  
  5.  
  6. $username = $_POST['acregisterusername'];
  7. $mail = $_POST['acregistermail'];
  8. $password = $_POST['acregisterpassword'];
  9.  
  10. $username = mysqli_real_escape_string($connection, (htmlspecialchars($username)));
  11. $password = mysqli_real_escape_string($connection, (htmlspecialchars($password)));
  12. $mail = mysqli_real_escape_string($connection, (htmlspecialchars($mail)));
  13.  
  14.  
  15. $string = md5($password.$mail);
  16.  
  17. $password = sha1($password);
  18.  
  19. $mail = strtolower($mail);
  20.  
  21.    
  22. if($connection && $selection){
  23.    
  24.     $usernamelower = strtolower($username);
  25.    
  26.     $queryuser = "SELECT * FROM `user` WHERE `Usernamelower` = '$usernamelower'";
  27.     $userresult = mysqli_query($connection, $queryuser);
  28.     $usercheck = mysqli_num_rows($userresult); 
  29.    
  30.    
  31.     if($usercheck == 0){
  32.        
  33.         $querymail = "SELECT * FROM `user` WHERE `E-Mail` = '$mail'";
  34.         $mailquery = mysqli_query($connection, $querymail);
  35.         $mailcheck = mysqli_num_rows($mailquery);  
  36.        
  37.         if($mailcheck == 0){
  38.        
  39.        
  40.         $registerquery = "INSERT INTO `user`( `Username`, `Password`, `E-Mail`,`val`,`Usernamelower` ) VALUES ('$username','$password','$mail', '$string','$usernamelower')";
  41.  
  42.         mysqli_query($connection, $registerquery);
  43.        
  44.        
  45.         $to = $mail;
  46.         $betreff = 'Account Activation : '.$username;
  47.         $body = '
  48. <html>
  49. <body>
  50. <p style="color:#000";>
  51. Dear '.$username.'
  52. <br><br>
  53. please confirm your E-mail adress with the link below.<br>
  54. After this step your account has full rights.
  55. <br><br><br>
  56. <a href="http://www.hurensohn.de/index.php?c='.$string.'">Confirm here</a><br>
  57. <br><br>
  58.  
  59. best regards,<br><br>your  hurensohn team<br><br><br>
  60. <span style="color:#000"><small>www.hurensohn.de <strong>&middot;</strong> info@hurensohn.de</small></span>
  61. </p>
  62. </body>
  63. </html>
  64.         ';
  65.         $header = "From: Hurensohn<no-reply@hurensohns.de> \r\n";
  66.         $header .= "MIME-Version: 1.0 \r\n";
  67.         $header .= "Content-type: text/html; charset=iso-8859-1 \r\n";
  68.  
  69.         $mail = mail($to,$betreff,$body,$header);
  70.         if($mail){ 
  71.         $error = 'done';
  72.         }
  73.        
  74.         }
  75.         else{
  76.             $error = "Mail";
  77.         }
  78.     }
  79.     else
  80.     {
  81.         $error='User'; 
  82.     }
  83. }
  84. else{
  85.  $error = 'Connection';
  86. }
  87.  
  88. mysqli_free_result($userresult);
  89.  
  90. mysqli_close($connection);
  91.  
  92. echo $error;
  93.  
  94. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement