Advertisement
prokawsar

Untitled

Mar 14th, 2017
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.79 KB | None | 0 0
  1. <?php
  2.  
  3. include 'conn.php';
  4. session_start();
  5.  
  6. $name = $_POST['name'];
  7. $username = $_POST['username'];
  8. $email = $_POST['email'];
  9. $pass = $_POST['password'];
  10. $country = $_POST['country'];
  11. $child = $_POST['child_no'];
  12.  
  13. if (!empty($name) && !empty($username) && !empty($email) && !empty($pass) ) {
  14.  
  15.     $sql = "INSERT INTO user (name, user_name, email, password, country, no_of_child)
  16.     VALUES ('$name', '$username', '$email', '$pass', '$country', '$child')";
  17.  
  18.     if ($conn->query($sql) === TRUE) {
  19.         echo "New record created successfully";
  20.         $_SESSION['succMsg'] ="You have signed up successfully";
  21.         header('location: clientlogin.php');
  22.     } else {
  23.         echo "Error: " . $sql . "<br>" . $conn->error;
  24.     }
  25. }
  26. else{
  27.     $_SESSION['errMsg'] = "You must have to fill all Fields !";
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement