Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $firstname = $_POST['first_name'];
- $lastname = $_POST['lastname'];
- $username = $_POST['username'];
- $email = $_POST['email'];
- $confirmemail = $_POST['confirmemail'];
- $password = $_POST['pass_id'];
- $confirmpassword = $_POST['confirmpassword'];
- $phone = $_POST['phone'];
- if($lastname !=''&& $firstname!=''&& $username !=''&& $email!=''&& $confirmemail !=''&&$password!=''&& $confirmpassword!=''&&$phone!='') {
- if(isset($firstname,$lastname,$username,$email,$confirmemail,$password,$confirmpassword,$phone)){
- global $conn;
- $firstname = mysqli_real_escape_string($conn,$_POST['first_name']);
- $lastname = mysqli_real_escape_string($conn,$_POST['lastname']);
- $username = mysqli_real_escape_string($conn,$_POST['username']);
- $email = mysqli_real_escape_string($conn,$_POST['email']);
- $confirmemail = mysqli_real_escape_string($conn,$_POST['confirmemail']);
- $password = mysqli_real_escape_string($conn,$_POST['pass_id']);
- $confirmpassword = mysqli_real_escape_string($conn,$_POST['confirmpassword']);
- $phone = mysqli_real_escape_string($conn,$_POST['phone']);
- if($email==$confirmemail){
- if(preg_match("^(?=.*[a-z])(?=.*[A-Z])(?=.*d)(?=.*[$@$!%*?&])[A-Za-zd$@$!%*?&]{8,}^",$_POST['pass_id'])==true){
- if($password ==$confirmpassword){
- if(preg_match("/\s/",$_POST['username'])!=true){
- if(user_exists($_POST['username'])!= true){
- if(email_checking($email)!=false){
- echo"you have sucessfuly regestered!check your email to activated your account";
- }else{
- echo "email is already in use";
- }
- }else{
- echo "user exists";
- }
- }else{
- echo"username must not contain any spaces";
- }
- }else{
- echo "password did not match";
- }
- }else{
- echo"Password should be 8 minimum and must contain atleast 1Upcase,1 number and 1 spacial character(example:someOne@123)";
- }
- }else{
- echo "email did not match";
- }
- }
- }else{
- echo "please fill all the fields!!";
- }
- function divsub(){
- var firstname= document.getElementById('first_name').value;
- var lastname= document.getElementById('lastname').value;
- var username= document.getElementById('username').value;
- var email= document.getElementById('email').value;
- var emailconfirm= document.getElementById('confirmemail').value;
- var pass= document.getElementById('pass_id').value;
- var passconfrim= document.getElementById('confirmpassword').value;
- var phone= document.getElementById('phone').value;
- var datastring = 'first_name='+firstname+'&lastname='+lastname+'&username='+username+'&email='+email+'&confirmemail='+emailconfirm+'&pass_id='+pass+'&confirmpassword='+passconfrim+'&phone='+phone;
- $.ajax({
- type:"POST",
- url:"regestration.php",
- data:datastring,
- cache:false,
- success:function(html){
- if(html=== "you have sucessfuly regestered!check your email to activated your account"){
- window.location.href = "rregsuccess.php";
- }else{
- $('#resto').html(html);
- }
- }
- });
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement