Guest User

Untitled

a guest
Feb 28th, 2018
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. my database field (id,username,password,user_type)
  2.  
  3. <?php
  4. if($_SERVER['REQUEST_METHOD']=='POST'){
  5.  
  6. include 'Config.php';
  7.  
  8. $con = mysqli_connect($HostName,$HostUser,$HostPass,$DatabaseName);
  9.  
  10. $username = $_POST['username'];
  11. $password = $_POST['password'];
  12. $user_type = $_POST['user_type'];
  13.  
  14.  
  15. $CheckSQL = "SELECT * FROM Login WHERE email='$email'";
  16.  
  17. $check = mysqli_fetch_array(mysqli_query($con,$CheckSQL));
  18.  
  19. if(isset($check)){
  20.  
  21. echo 'Sorry Email Already Exist';
  22.  
  23. }
  24. else{
  25. $Sql_Query = "INSERT INTO Login (username,password,user_type) values ('$email','$password','$user_type')";
  26.  
  27. if(mysqli_query($con,$Sql_Query))
  28. {
  29. echo 'Registration Successfully';
  30. }
  31. else
  32. {
  33. echo 'Error Something Wrong';
  34. }
  35. }
  36. }
  37. mysqli_close($con);
  38. ?>
Add Comment
Please, Sign In to add comment