I need to do redirect in functions.php
-
I use contact form 7 and I save my data in bbdd when the form is fill. For that use:
add_action( 'wpcf7_before_send_mail', 'save_form' ); function save_form( $wpcf7 ) { global $wpdb; $submission = WPCF7_Submission::get_instance(); if ( $submission ) { $submited = array(); $submited['title'] = $wpcf7->title(); $submited['posted_data'] = $submission->get_posted_data(); } $data = array( 'empresa' => $submited['posted_data']['your-empresa'], 'nombre' => $submited['posted_data']['your-nombre'], 'apellido' => $submited['posted_data']['your-apellidos'], ); $table = $wpdb->prefix . 'users'; $success = $wpdb->insert( $table, $data ); // doesn't work //wp_redirect( "/info-contratar/" ); exit(); //wp_redirect(site_url('/info-contratar')); exit(); //header("Location: /info-contratar/"); exit(); return $success; }When functions end. I need use other view: info-contactar, but it never doing redirect. Only I see a Get request with firebug tool.
How can I do redirect and show my page info-contratar?
Regards!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘I need to do redirect in functions.php’ is closed to new replies.