Form is not getting submitted [closed]

First of all you are doing everything wrong as a WordPress developer.

  1. Make a habit of using wp_nonce and other security steps.
  2. When possible try to avoid inline JavaScript or JavaScript on the same file.
  3. Important: why you are creating new database connection..? Why you are writing database queries in your own way? Why don’t you follow WordPress codex? WordPress has very simple way to do this.

After making those changes do something like this in your functions.p hp or register.php file

add_action( 'init', 'insertFn');
function insertFn(){
    if(isset($_REQUEST['submit'])){
        //Your form processing code.
     }
}

Please remember sometimes looking at the official documentation is very helpful.