Advertisement
Guest User

Untitled

a guest
Mar 20th, 2018
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. <?php
  2. session_start();
  3.  
  4. $email = $_SESSION['regEmail'];
  5. $name = $_SESSION['regFName'] ." ". $_SESSION['regLName'];
  6. $password = $_SESSION['regPass'];
  7. $firstname = $_SESSION['regFName'];
  8. $lastname = $_SESSION['regLName'];
  9. $username = $_SESSION['regUName'];
  10.  
  11. $to = $email;
  12. $subject = "Registration";
  13. $txt = "Thank you for registering with us! \n\n Your account details are as follows: \n Email: $email \n Name: $name \n Username: $username \n Password: $password \n\n Please remember any private info you enter such as your password will be unreadable by us as they are automatically hashed into random numbers and letters!\n\n To Activate you account please click this link to activate your account https://joshlisher.dhwh.co.uk/new/site/account/activate.php?email=$email";
  14. $headers = "From: webmaster@armchairgaming.co.uk";
  15.  
  16. mail($to,$subject,$txt,$headers);
  17.  
  18. include("../includes/dbConnect.php");
  19.  
  20. $encPass = hash('sha256', $password);
  21.  
  22. $sql = "INSERT INTO members (firstname, lastname, username, password, email) VALUES ('$firstname', '$lastname', '$username', '$encPass', '$email')";
  23.  
  24. if ($conn->query($sql) === TRUE) {
  25. header("Location: accountCreated.php?email=$email");
  26. } else {
  27. $_SESSION['error'] = "There was an error. please contact the system admin!";
  28. header('Location: ../index.php');
  29. }
  30. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement