Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require 'global.php';
- $username = $_POST['acregisterusername'];
- $mail = $_POST['acregistermail'];
- $password = $_POST['acregisterpassword'];
- $username = mysqli_real_escape_string($connection, (htmlspecialchars($username)));
- $password = mysqli_real_escape_string($connection, (htmlspecialchars($password)));
- $mail = mysqli_real_escape_string($connection, (htmlspecialchars($mail)));
- $string = md5($password.$mail);
- $password = sha1($password);
- $mail = strtolower($mail);
- if($connection && $selection){
- $usernamelower = strtolower($username);
- $queryuser = "SELECT * FROM `user` WHERE `Usernamelower` = '$usernamelower'";
- $userresult = mysqli_query($connection, $queryuser);
- $usercheck = mysqli_num_rows($userresult);
- if($usercheck == 0){
- $querymail = "SELECT * FROM `user` WHERE `E-Mail` = '$mail'";
- $mailquery = mysqli_query($connection, $querymail);
- $mailcheck = mysqli_num_rows($mailquery);
- if($mailcheck == 0){
- $registerquery = "INSERT INTO `user`( `Username`, `Password`, `E-Mail`,`val`,`Usernamelower` ) VALUES ('$username','$password','$mail', '$string','$usernamelower')";
- mysqli_query($connection, $registerquery);
- $to = $mail;
- $betreff = 'Account Activation : '.$username;
- $body = '
- <html>
- <body>
- <p style="color:#000";>
- Dear '.$username.'
- <br><br>
- please confirm your E-mail adress with the link below.<br>
- After this step your account has full rights.
- <br><br><br>
- <a href="http://www.hurensohn.de/index.php?c='.$string.'">Confirm here</a><br>
- <br><br>
- best regards,<br><br>your hurensohn team<br><br><br>
- <span style="color:#000"><small>www.hurensohn.de <strong>·</strong> info@hurensohn.de</small></span>
- </p>
- </body>
- </html>
- ';
- $header = "From: Hurensohn<no-reply@hurensohns.de> \r\n";
- $header .= "MIME-Version: 1.0 \r\n";
- $header .= "Content-type: text/html; charset=iso-8859-1 \r\n";
- $mail = mail($to,$betreff,$body,$header);
- if($mail){
- $error = 'done';
- }
- }
- else{
- $error = "Mail";
- }
- }
- else
- {
- $error='User';
- }
- }
- else{
- $error = 'Connection';
- }
- mysqli_free_result($userresult);
- mysqli_close($connection);
- echo $error;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement