I want to check the inputs of a form if they are empty and then i want to use php codes for user registeration.
    <script> 
    $('#submitbutton').click(function(){
       if($('#usernameinput').val() == ''){
          alert('Input is blank');
       }
       else {
             //here i want to use php codes for example;
$bgl = new mysqli("localhost", "root", "", "users");
if ($bgl->connect_errno) {
echo "Failed to connect to MySQL: (" . $bgl->connect_errno . ") " . $bgl->connect_error;
}
$username = mysql_real_escape_string($_POST['username']);
          .....
          .....
          ..... /and so on.. 
       }
    });
    </script>
 
     
     
    