Advertisement
phirani

Registration Check

Dec 19th, 2014
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. <?php
  2.  
  3. session_start();
  4.  
  5.  
  6. $name = $_POST['name'];
  7. $lname = $_POST['lname'];
  8. $uname = $_POST['uname'];
  9. $pass = $_POST['pass'];
  10. $pass1 = $_POST['pass1'];
  11. $email = $_POST['email'];
  12. $email1 = $_POST['email1'];
  13.  
  14. $to = "$email";
  15. $subject = " dickhead ur mum";
  16. $txt = "ur dads an ass";
  17. $headers = "From: webmaster@phirani.com" ."\r\n";
  18.  
  19. mail($to,$subject,$txt,$headers);
  20.  
  21.  
  22. if (empty($name) || empty($lname) || empty($uname) ||
  23. empty($pass) || empty($pass1) || empty($email) || empty($email1)){
  24.  
  25. die("<br> Please fill out the form correctly<br />");
  26.  
  27. }
  28. echo("Thank you $name your registration form has been accepted and a confirmation email will be sent to $email");
  29.  
  30.  
  31.  
  32.  
  33.  
  34. $servername = "localhost";
  35. $username = "root";
  36. $password = "";
  37. $dbname = "dbusers";
  38.  
  39.  
  40.  
  41. // Create connection
  42. $conn = new mysqli($servername, $username, $password, $dbname);
  43. // Check connection
  44. if ($conn->connect_error) {
  45. die("Connection failed: " . $conn->connect_error);
  46. }
  47.  
  48. $sql = "INSERT INTO dropbox (name, lname, uname, pass, pass1, email, email1)
  49. VALUES ('$name', '$lname','$uname','$pass','$pass1' ,'$email','$email1')";
  50.  
  51. if ($conn->query($sql) === TRUE) {
  52. echo "New record created successfully";
  53. } else {
  54. echo "Error: " . $sql . "<br>" . $conn->error;
  55. }
  56.  
  57. $conn->close();
  58.  
  59.  
  60. ?>
  61.  
  62.  
  63. <html>
  64.  
  65. <body>
  66.  
  67. <a href="form.html">Login</a>
  68.  
  69. </body>
  70.  
  71. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement