Advertisement
Guest User

Untitled

a guest
Nov 4th, 2017
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.32 KB | None | 0 0
  1. /* <?php require_once("includes/connection.php"); ?>
  2.  
  3. <?php
  4.  
  5.         if(isset($_POST["register"])){
  6.  
  7.         if(!empty($_POST['full_name']) && !empty($_POST['email']) && !empty($_POST['username']) && !empty($_POST['password'])) {
  8.   $full_name= htmlspecialchars($_POST['full_name']);
  9.         $email=htmlspecialchars($_POST['email']);
  10.  $username=htmlspecialchars($_POST['username']);
  11.  $password=htmlspecialchars($_POST['password']);
  12.  $query=mysqli_query("SELECT * FROM usertbl WHERE username='".$username."'");
  13.   $numrows=mysql_num_rows($query);
  14. if($numrows==0)
  15.    {
  16.         $sql="INSERT INTO usertbl
  17.  (full_name, email, username,password)
  18.        VALUES('$full_name','$email', '$username', '$password')";
  19.   $result=mysqli_query($sql);
  20.  if($result){
  21.         $message = "Account Successfully Created";
  22. } else {
  23.  $message = "Failed to insert data information!";
  24.   }
  25.         } else {
  26.         $message = "That username already exists! Please try another one!";
  27.    }
  28.         } else {
  29.         $message = "All fields are required!";
  30.         }
  31.         }
  32.         ?>
  33.  
  34.         <?php if (!empty($message)) {echo "<p class=\"error\">" . "MESSAGE: ". $message . "</p>";} ?>
  35. */
  36. <?php include("includes/header.php") ?>
  37.  
  38. <div class="container mregister">
  39. <div id="login">
  40.  <h1>         ^  ^  ^    ^    ^ </h1>
  41. <form action="register.php" id="registerform" method="post"name="registerform">
  42.  <p><label for="user_login"> ^                 ^ <br>
  43.  <input class="input" id="full_name" name="full_name"size="32"  type="text" value=""></label></p>
  44. <p><label for="user_pass">E-mail<br>
  45. <input class="input" id="email" name="email" size="32"type="email" value=""></label></p>
  46. <p><label for="user_pass"> ^    ^         ^          ^      ^ <br>
  47. <input class="input" id="username" name="username"size="20" type="text" value=""></label></p>
  48. <p><label for="user_pass"> ^    ^      ^ <br>
  49. <input class="input" id="password" name="password"size="32"   type="password" value=""></label></p>
  50. <p class="submit"><input class="button" id="register" name= "register" type="submit" value=" ^    ^        ^  ^  ^    ^        ^  ^  ^  ^ "></p>
  51.           <p class="regtext">            ^        ^  ^  ^    ^          ^ ? <a href= "login.php"> ^          ^         ^         ^          ^      ^ </a>!</p>
  52.  </form>
  53. </div>
  54. </div>
  55. <?php include("includes/footer.php"); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement