daily pastebin goal
61%
SHARE
TWEET

Untitled

a guest Jun 13th, 2018 103 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <body>
  2. <table class="table1">
  3. <form action="" method="POST">
  4. <tr><div class="div1"><h2>Register</h2></div></tr>
  5. <tr><p>EMAIL<p></tr>
  6. <tr><input class="input" type="text" name="mail" autofocus/></tr>
  7. <tr><p>USER NAME<p></tr>
  8. <tr><input class="input"  type="text" name="username" /></tr>
  9. <tr><p>FIRST NAME<p></tr>
  10. <tr><input class="input"  type="text" name="first_name" /></tr>
  11. <tr><p>LAST NAME<p></tr>
  12. <tr><input class="input"  type="text" name="last_name" /></tr>
  13. <tr><p>BORN DATE<p></tr>
  14. <tr><input class="input"  type="date" name="date" /></tr>
  15. <tr><p>PASSWORD<p></tr>
  16. <tr><input class="input" type="password"  name="password"  />
  17. <tr><p>REPEAT PASSWORD<p></tr>
  18. <tr><input class="input" type="password"  name="password2"  /></tr><br><br>
  19. <tr><input class="login" type="submit" name="submit" value="REGISTER" /></tr>
  20. <tr><a href="./login.php"> <p class="create">Sign in...<p></a></tr>
  21. </form>
  22. </body>
  23. </html>
  24. <?php
  25. include('./Functions/db.php');
  26. include('./Functions/function.php');
  27. if (isset($_POST['submit']))
  28. {
  29. $mail=$_POST['mail'];
  30. if(trim($_POST['password'])=='' || trim($_POST['password2'])=='' || trim($_POST['mail'])=='' || trim($_POST['username'])=='' || trim($_POST['first_name'])=='' || trim($_POST['last_name'])=='' || trim($_POST['date'])=='')
  31. {
  32.     echo'  <center><div class="alert alert-warning alert-dismissible">
  33.     <button type="button" class="close" data-dismiss="alert">&times;</button>
  34.     <strong><i class="material-icons">&#xe001;</i></strong> All fields are required!
  35.   </div></center>';
  36. }
  37. else if ($_POST['password']!= $_POST['password2'])
  38.  {
  39.     echo ' <tr><center>  <div class="alert alert-danger alert-dismissible">
  40.     <button type="button" class="close" data-dismiss="alert">&times;</button>
  41.     <strong><i class="material-icons">&#xe001;</i></strong> Passwords do not match
  42.   </div> </center></tr> ';
  43. }
  44. else if (!filter_var($mail, FILTER_VALIDATE_EMAIL)) {
  45.     echo ' <tr><center>  <div class="alert alert-danger alert-dismissible">
  46.     <button type="button" class="close" data-dismiss="alert">&times;</button>
  47.     <strong><i class="material-icons">&#xe001;</i></strong> E-Mail is not valid
  48.   </div> </center></tr> ';
  49. }
  50. else if (fnCheckEmail($mail)>0) {
  51.     echo ' <tr><center>  <div class="alert alert-danger alert-dismissible">
  52.     <button type="button" class="close" data-dismiss="alert">&times;</button>
  53.     <strong><i class="material-icons">&#xe001;</i></strong> E-Mail already exist
  54.   </div> </center></tr> ';
  55. }
  56. else {
  57. $mail=$_POST['mail'];
  58. $username=$_POST['username'];
  59. $first_name=$_POST['first_name'];
  60. $last_name=$_POST['last_name'];
  61. $date=$_POST['date'];
  62. $password=$_POST['password'];
  63. $conn=fnConnDb();
  64. $qryCreate="insert into Accounts (username, password, first_name, last_name, mail, born_date) values ('$username', '$password', '$first_name', '$last_name' , '$mail', '$data')";
  65. mysqli_query($conn,$qryCreate);
  66. header("Refresh: 3; URL=./login.php");
  67.     echo '<tr><center>   <div class="alert alert-success alert-dismissible">
  68.     <button type="button" class="close" data-dismiss="alert">&times</button>
  69.     <div class="login-alert" ><i class="material-icons">&#xe86c;</i>  Your account is ready to use
  70.   </div></center></tr></table>';
  71. }
  72. }
  73. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top