Advertisement
Guest User

Untitled

a guest
May 12th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.03 KB | None | 0 0
  1. <!------------------------------------------------------PHP------------------------------------------------------->
  2.  
  3. <?php include 'connectDB.php';
  4. $username='';
  5. $password='';
  6. $email='';
  7. $contact='';
  8. $address='';
  9.  
  10.  
  11. if (isset($_POST['register'])) {
  12. $username = $_POST['username'];
  13. $password = $_POST['password'];
  14. $email = $_POST['email'];
  15. $contact = $_POST['contact'];
  16. $address = $_POST['address'];
  17.  
  18.  
  19. $result=mysqli_query($con,"INSERT INTO lab5_user(username,password,email,contact,address) VALUES ('$username','$password','$email','$contact','$address')");
  20.  
  21. if($result)
  22. {
  23. echo '<script>';
  24. echo 'alert("Registration Successful");';
  25. echo 'window.location.href = "loginPage.php";';
  26. echo '</script>';
  27. }
  28. else
  29. {
  30. echo '<script>';
  31. echo 'alert("Registration Failed");';
  32. echo '</script>';
  33. echo("Error description: " . mysqli_error($con));
  34. }
  35. }
  36. ?>
  37.  
  38. <!------------------------------------------------------CS------------------------------------------------------->
  39.  
  40. <style>
  41. body{
  42. background-image: url(images/cover2.jpg) ;
  43. background-size: 100%;
  44. background-repeat: no-repeat;
  45. background-position: center;
  46. }
  47.  
  48. .containerReg{
  49. text-align: center;
  50. margin:0px;
  51. padding-top:30px;
  52. }
  53.  
  54. input[type=text],input[type=email],input[type=password],button[type=submit],select {
  55. width: 20%%;
  56. padding: 12px 20px;
  57. margin: 8px 0;
  58. display: inline-block;
  59. border: 2px solid #000000;
  60. border-radius: 14px;
  61. box-sizing: border-box;
  62. text-align: center
  63. }
  64.  
  65. h3{
  66. font-family: Arial, Helvetica, sans-serif;
  67. font-size: 70px;
  68. color: #f2f2f2;
  69. margin:20px;
  70.  
  71. }
  72.  
  73. .btnReg:hover {
  74. background-color: #ffffff; /* Green */
  75. color: black;
  76. }
  77.  
  78. p{
  79. font-size:20px;
  80. font-weight: bold;
  81. color:white;
  82. }
  83.  
  84. a{
  85. color: white;
  86. font-size:23px;
  87. font-weight: bold;
  88.  
  89. }
  90. a:hover{
  91. color: black;
  92. }
  93. </style>
  94.  
  95. <!------------------------------------------------------HTML------------------------------------------------------->
  96.  
  97. <body>
  98. <div class="containerReg">
  99. <h3>REGISTRATION</h3>
  100. <form method="post">
  101. <input type=text id="username" name="username" placeholder="Enter a username" required>
  102. <br>
  103. <input type=password id="password" name="password" placeholder="Enter a password" required>
  104. <br>
  105. <br>
  106. <input type=text id="email" name="email" placeholder="Enter Email" required>
  107. <br>
  108. <input type=text id="contact" name="contact" placeholder="Enter Contact" required>
  109. <br>
  110. <input type=text id="address" name="address" placeholder="Enter Address" required>
  111. <br>
  112. <button class=btnReg type="submit" name="register" id=register>Register</button>
  113. <br>
  114. </form>
  115. </div>
  116. </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement