Advertisement
Guest User

Untitled

a guest
Jan 1st, 2017
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.53 KB | None | 0 0
  1. $firstname = $_POST['first_name'];
  2. $lastname = $_POST['lastname'];
  3. $username = $_POST['username'];
  4. $email = $_POST['email'];
  5. $confirmemail = $_POST['confirmemail'];
  6. $password = $_POST['pass_id'];
  7. $confirmpassword = $_POST['confirmpassword'];
  8. $phone = $_POST['phone'];
  9. if($lastname !=''&& $firstname!=''&& $username !=''&& $email!=''&& $confirmemail !=''&&$password!=''&& $confirmpassword!=''&&$phone!='') {
  10. if(isset($firstname,$lastname,$username,$email,$confirmemail,$password,$confirmpassword,$phone)){
  11. global $conn;
  12. $firstname = mysqli_real_escape_string($conn,$_POST['first_name']);
  13. $lastname = mysqli_real_escape_string($conn,$_POST['lastname']);
  14. $username = mysqli_real_escape_string($conn,$_POST['username']);
  15. $email = mysqli_real_escape_string($conn,$_POST['email']);
  16. $confirmemail = mysqli_real_escape_string($conn,$_POST['confirmemail']);
  17. $password = mysqli_real_escape_string($conn,$_POST['pass_id']);
  18. $confirmpassword = mysqli_real_escape_string($conn,$_POST['confirmpassword']);
  19. $phone = mysqli_real_escape_string($conn,$_POST['phone']);
  20. if($email==$confirmemail){
  21. if(preg_match("^(?=.*[a-z])(?=.*[A-Z])(?=.*d)(?=.*[$@$!%*?&])[A-Za-zd$@$!%*?&]{8,}^",$_POST['pass_id'])==true){
  22.  
  23. if($password ==$confirmpassword){
  24. if(preg_match("/\s/",$_POST['username'])!=true){
  25. if(user_exists($_POST['username'])!= true){
  26. if(email_checking($email)!=false){
  27.  
  28. echo"you have sucessfuly regestered!check your email to activated your account";
  29. }else{
  30. echo "email is already in use";
  31. }
  32. }else{
  33. echo "user exists";
  34. }
  35. }else{
  36. echo"username must not contain any spaces";
  37. }
  38. }else{
  39. echo "password did not match";
  40. }
  41.  
  42. }else{
  43. echo"Password should be 8 minimum and must contain atleast 1Upcase,1 number and 1 spacial character(example:someOne@123)";
  44.  
  45.  
  46. }
  47. }else{
  48. echo "email did not match";
  49. }
  50.  
  51.  
  52. }
  53.  
  54. }else{
  55. echo "please fill all the fields!!";
  56.  
  57. }
  58.  
  59. function divsub(){
  60. var firstname= document.getElementById('first_name').value;
  61. var lastname= document.getElementById('lastname').value;
  62. var username= document.getElementById('username').value;
  63. var email= document.getElementById('email').value;
  64. var emailconfirm= document.getElementById('confirmemail').value;
  65. var pass= document.getElementById('pass_id').value;
  66. var passconfrim= document.getElementById('confirmpassword').value;
  67. var phone= document.getElementById('phone').value;
  68. var datastring = 'first_name='+firstname+'&lastname='+lastname+'&username='+username+'&email='+email+'&confirmemail='+emailconfirm+'&pass_id='+pass+'&confirmpassword='+passconfrim+'&phone='+phone;
  69. $.ajax({
  70.  
  71. type:"POST",
  72. url:"regestration.php",
  73. data:datastring,
  74. cache:false,
  75. success:function(html){
  76. if(html=== "you have sucessfuly regestered!check your email to activated your account"){
  77. window.location.href = "rregsuccess.php";
  78.  
  79. }else{
  80. $('#resto').html(html);
  81.  
  82. }
  83.  
  84.  
  85.  
  86.  
  87. }
  88.  
  89. });
  90. return false;
  91. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement