Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!------------------------------------------------------PHP------------------------------------------------------->
- <?php include 'connectDB.php';
- $username='';
- $password='';
- $email='';
- $contact='';
- $address='';
- if (isset($_POST['register'])) {
- $username = $_POST['username'];
- $password = $_POST['password'];
- $email = $_POST['email'];
- $contact = $_POST['contact'];
- $address = $_POST['address'];
- $result=mysqli_query($con,"INSERT INTO lab5_user(username,password,email,contact,address) VALUES ('$username','$password','$email','$contact','$address')");
- if($result)
- {
- echo '<script>';
- echo 'alert("Registration Successful");';
- echo 'window.location.href = "loginPage.php";';
- echo '</script>';
- }
- else
- {
- echo '<script>';
- echo 'alert("Registration Failed");';
- echo '</script>';
- echo("Error description: " . mysqli_error($con));
- }
- }
- ?>
- <!------------------------------------------------------CS------------------------------------------------------->
- <style>
- body{
- background-image: url(images/cover2.jpg) ;
- background-size: 100%;
- background-repeat: no-repeat;
- background-position: center;
- }
- .containerReg{
- text-align: center;
- margin:0px;
- padding-top:30px;
- }
- input[type=text],input[type=email],input[type=password],button[type=submit],select {
- width: 20%%;
- padding: 12px 20px;
- margin: 8px 0;
- display: inline-block;
- border: 2px solid #000000;
- border-radius: 14px;
- box-sizing: border-box;
- text-align: center
- }
- h3{
- font-family: Arial, Helvetica, sans-serif;
- font-size: 70px;
- color: #f2f2f2;
- margin:20px;
- }
- .btnReg:hover {
- background-color: #ffffff; /* Green */
- color: black;
- }
- p{
- font-size:20px;
- font-weight: bold;
- color:white;
- }
- a{
- color: white;
- font-size:23px;
- font-weight: bold;
- }
- a:hover{
- color: black;
- }
- </style>
- <!------------------------------------------------------HTML------------------------------------------------------->
- <body>
- <div class="containerReg">
- <h3>REGISTRATION</h3>
- <form method="post">
- <input type=text id="username" name="username" placeholder="Enter a username" required>
- <br>
- <input type=password id="password" name="password" placeholder="Enter a password" required>
- <br>
- <br>
- <input type=text id="email" name="email" placeholder="Enter Email" required>
- <br>
- <input type=text id="contact" name="contact" placeholder="Enter Contact" required>
- <br>
- <input type=text id="address" name="address" placeholder="Enter Address" required>
- <br>
- <button class=btnReg type="submit" name="register" id=register>Register</button>
- <br>
- </form>
- </div>
- </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement