Advertisement
Guest User

Untitled

a guest
Sep 18th, 2016
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.23 KB | None | 0 0
  1. <?php
  2. require('connect.php');
  3. // If the values are posted, insert them into the database.
  4. if (isset($_POST['username']) && isset($_POST['password'])){
  5. $username = $_POST['username'];
  6. $email = $_POST['email'];
  7. $password = $_POST['password'];
  8.  
  9. $query = "INSERT INTO `user` (username, password, email) VALUES ('$username', '$password', '$email')";
  10. $result = mysqli_query($connection, $query);
  11. if($result){
  12. $smsg = "User Created Successfully.";
  13. }else{
  14. $fmsg ="User Registration Failed";
  15. }
  16. }
  17. ?>
  18. <html>
  19. <head>
  20. <title>Register</title>
  21.  
  22. <!-- Latest compiled and minified CSS -->
  23. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" >
  24.  
  25. <!-- Optional theme -->
  26. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" >
  27.  
  28. <link rel="stylesheet" href="styles.css" >
  29.  
  30. <!-- Latest compiled and minified JavaScript -->
  31. <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"> </script>
  32. </head>
  33. <body>
  34. <div class="container">
  35. <form class="form-signin" method="POST">
  36.  
  37. <?php if(isset($smsg)){ ?><div class="alert alert-success" role="alert"> <?php echo $smsg; ?> </div><?php } ?>
  38. <?php if(isset($fmsg)){ ?><div class="alert alert-danger" role="alert"> <?php echo $fmsg; ?> </div><?php } ?>
  39. <h2 class="form-signin-heading">Please Register</h2>
  40. <div class="input-group">
  41. <span class="input-group-addon" id="basic-addon1">@</span>
  42. <input type="text" name="username" class="form-control" placeholder="Username" required>
  43. </div>
  44. <label for="inputEmail" class="sr-only">Email address</label>
  45. <input type="email" name="email" id="inputEmail" class="form-control" placeholder="Email address" required autofocus>
  46. <label for="inputPassword" class="sr-only">Password</label>
  47. <input type="password" name="password" id="inputPassword" class="form-control" placeholder="Password" required>
  48. <div class="checkbox">
  49. <label>
  50. <input type="checkbox" value="remember-me"> Remember me
  51. </label>
  52. </div>
  53. <button class="btn btn-lg btn-primary btn-block" type="submit">Register</button>
  54. <a class="btn btn-lg btn-primary btn-block" href="login.php">Login</a>
  55. </form>
  56. </div>
  57.  
  58. </body>
  59.  
  60. </html>
  61.  
  62. Link is http://ferryboat505.ga/ferryboat505/register.php/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement