Pass data from one page to anothe file/page in wordpress

You can try to use functions.php to handle the form submission and send the data via AJAX.

Add a hidden field in your form with the action to be taken (on functions.php):

<input type="hidden" name="action" value="save_contact"/>

In you footer.php add the jQuery code to handle the AJAX request:

jQuery('#your-form').submit(ajaxSubmit);
function ajaxSubmit(e){
    e.preventDefault();
var formData = jQuery(this).serialize()

jQuery.ajax({
    type:"POST",
    url: "<?php bloginfo('url'); ?>/wp-admin/admin-ajax.php",
        data: formData,
        success: function(response){
       //SHOW CONFIRMATION
    },
    error: function(error){
       //SHOW ERROR MESSAGE
    }
});
return false;
}

Finally, In you functions.php file:

add_action('wp_ajax_save_contact', 'save_contact');
add_action('wp_ajax_nopriv_save_contact', 'save_contact');
function save_contact(){
     //Do whatever you want here...
}

Hope it helps! 🙂