Advertisement
Guest User

Untitled

a guest
Jun 27th, 2016
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. <?php
  2. require_once('./inc/ses_check.php');
  3. require_once('./inc/mysql_connection.php');
  4. require_once('./inc/my_functions.php');
  5. if(isset($_POST['pr_action'])){
  6. $action=$_POST['pr_action'];
  7. switch($action){
  8. case 1://this is for add
  9. $username=$_POST['username'];
  10. $fullname=$_POST['fullname'];
  11. $usertype=$_POST['usertype'];
  12. $password=$_POST['pwd'];
  13. $retries=0;
  14.  
  15. if(!isUserNameExist($username)){
  16. $sql="INSERT INTO tbl_users (username,fullname,pwd,retries,usertype)
  17. Values('$username','$fullname','$pwd',$retries,'$usertype')";
  18. $result=mysql_query($sql);
  19. header('location:user_mgmt.php');
  20.  
  21.  
  22. }else{
  23. echo('Username Exists');
  24. }
  25. break;
  26. default:
  27. break;
  28. }
  29. }else{
  30. die(mysql_error());
  31. }
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement