Advertisement
Guest User

Untitled

a guest
Apr 16th, 2017
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.31 KB | None | 0 0
  1. <?php
  2. include("../Database/database.php");
  3.  
  4. ?>
  5. <!DOCTYPE html>
  6. <html>
  7. <head>
  8. <title>Registration Page</title>
  9. <style type="text/css">
  10. .reg{
  11. height: 500px;
  12. width: 400px;
  13. padding:20px;
  14. background: grey;
  15. margin: auto;
  16. }
  17. h1{
  18. text-align: center;
  19. font-family: 'Trebuchet MS';
  20. color: Black;
  21. }
  22. input[type= text], input[type= password], input[type=email]{
  23. width: 100%;
  24. height: 30px;
  25. font-size: 15px;
  26. }
  27. label{
  28. font-size: 20px;
  29. font-family: 'Trebuchet MS';
  30. color: ;
  31. }
  32. input[type= submit]{
  33. width: 70px;
  34. height: 30px;
  35. color: green;
  36. margin: auto;
  37. font-size: 16px;
  38. }
  39. body{
  40. background-image: url('bg.jpg');
  41. }
  42.  
  43. </style>
  44.  
  45.  
  46.  
  47. </head>
  48. <body >
  49. <h1>Registration Form</h1>
  50. <div class= "reg">
  51. <form method= 'post'>
  52. <label>First Name</label>
  53. <input type="text" placeholder= "Enter your first name" name= "fn" required></br>
  54. <label>Last name</label>
  55. <input type="text" placeholder= "Enter your last name" name= "ln" required></br>
  56. <label>Username</label>
  57. <input type="text" placeholder= "Enter your username" name= "un" required></br>
  58. <label>Password</label>
  59. <input type= "password" placeholder= "Enter password" name= "pw" required></br>
  60. <label>Email address</label>
  61. <input type= "Email" placeholder= "Enter email" name= "em" required>
  62. <label>Address</label>
  63. <input type= "text" placeholder= "Enter Address" name= "add" required></br>
  64. <label>Phone No.</label>
  65. <input type= "text" placeholder="Enter phn no." name= "phn" required></br>
  66. </p>
  67. <input type="Submit" name="send">
  68. </div>
  69. </form>
  70. </body>
  71. </html>
  72.  
  73. <?php
  74. if(isset($_REQUEST['send']))
  75. {
  76. $first_name = $_POST['fn'];
  77. $last_name = $_POST['ln'];
  78. $user= $_POST['un'];
  79. $password= $_POST['pw'];
  80. $email= $_POST['em'];
  81. $address= $_POST['add'];
  82. $phone= $_POST['phn'];
  83. $personal_info= "insert into children_registration(`user_id`, `first_name`,`last_name`,`username`, `password`, `email`, `address`, `phn_no`) values(NULL, '$first_name', '$last_name', $user', '$password', '$email', 'address', '$phone')";
  84. if($conn->query($personal_info) == true){
  85. ?>
  86. <script type="text/javascript">
  87. window.confirm('You are successfully Registered"')
  88. window.location.href= 'login.php';
  89. </script>
  90. <?php
  91. }
  92. else{
  93. echo "Error: ".$conn->error;
  94. }
  95. }
  96. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement