<?php


    include '../connection.php';

    if(isset($_POST['submit'])) {

      

      $user_name = $_POST['name'];

      $father_name = $_POST['faname'];

      $gender = $_POST['gender'];

      $user_email = $_POST['email'];

      $user_mobile = $_POST['mobile'];

      $password= $_POST['pass'];

      $cpassword = $_POST['cpass'];


}

       $pass = password_hash($password, PASSWORD_BCRYPT);

        $cpass = password_hash($cpassword, PASSWORD_BCRYPT);


        $emailquery = "select * form registration where email='$user_email'";


        $query = mysql_query($con,$emailquery);


        $emailcount = musqli_num_rows($query);


        if($emailcount>0){

          ?>

          <script>


            alert("Email Already Exists. Please Use Diffrent Email Id");

            window.location.replace('../register.php');


           

          </script>

          <?php

        }

        else{


            if($password === $cpassword){


        $innsertquery = "insert in to registration(name,faname,gender,email,mobile,password,cpassword)

        value(' $user_name','$father_name',' $gender','$user_email','$user_mobile','$pass','$cpass',)";


        $iquery = mysqli_query($con,$innsertquery);


          if($iquery){

            ?>

          <script>


            alert("Registration Successfully.");

            window.location.replace('../register.php');


           

          </script>

          <?php

            }else{

              ?>

          <script>


            alert("No Registration.");

            window.location.replace('../register.php');


           

          </script>

          <?php

            }


          }

          else{

            ?>

          <script>


            alert("Password Are Not Matched. Please Enter Correct Password.");

            window.location.replace('../register.php');

           

          </script>

          <?php

               }

           

            }

       

         }


     ?>


REGISTRATION CODE IN PHP