How to send form values from the script in functions.php and not from the form on my website?
I have a form on my website and depending on if the user check paypal or wire-transfer the form action should always go to functions.php where I have this simple check at the end of the file:
if ( isset( $_POST['submitted'] ) isset( $_POST['post_nonce_field'] ) wp_verify_nonce( $_POST['post_nonce_field'], 'post_nonce' ) ) {
// CODE AFTER SUBMIT HERE
}
So, my question is how do I do some stuff using an if condition in my functions.php before posting the form to PayPal?
Because all tutorials have form action https://www.sandbox.paypal.com/cgi-bin/webscr
How could I send all the post info from the formular (I can grab the values and stoere them in variables) via this address https://www.sandbox.paypal.com/cgi-bin/webscr
?
Is it somehow possible doing this and not using form to send the values there?
Does WordPress have any function to send post request to a distant url?