This topic is: not resolved
-
Hello
I have a form that was posting to a external url the submitted data that was solved here in a old ticket.
I have upgraded to DHVC Version: 2.2.0 and the bellow code doesn’t work anymore.
function dhvc_form_before_processor_custom_redirect($form_id){ if(isset($_POST['arrival']) && isset($_POST['departure'])){ //Your form id $form_id = 896; //you external url $redirect_url = 'https://loletlola.book-onlinenow.net/index.aspx?Page=19&lan_id=ro-RO'; //only send field name to external url $allow_fields = array( 'arrival', 'departure', 'rooms', 'adults', 'adults' ); foreach ($allow_fields as $allow_field){ if(isset($_POST[$allow_field]) && !empty($_POST[$allow_field])){ $redirect_url = add_query_arg($allow_data,$_POST[$allow_field],$redirect_url); } } wp_redirect(urldecode_deep($redirect_url)); die; } } add_action('dhvc_form_before_processor','dhvc_form_before_processor_custom_redirect');
What would be the new functions.php code to make it work on DHVC version 2.2.0 ?
Regards.