Hi All, I have the following code that is supposed to call a thank you page url in a separate window once the form is submitted: f($result[tch_appSuccess] == 0){ $lasttwo = substr($result["errorCode"], -2); if($result["errorCode"]== "1001" OR $lasttwo == "91" OR $lasttwo == "92" OR $lasttwo == "82" OR $lasttwo == "83" OR $lasttwo == "84"){ // Lead was not submitted, email all info to the affiliate and exit $msg = $result["errorMsg"]. ":: Error Code ".$result["errorCode"]; $failed_to_submit = "yes"; include("pmi-email.php"); header("Location: ".get_bloginfo('url').'/thankyou/'); exit; } $error_field = $result['errorField']; $error_msg = $result['errorMsg']; However I get the following error: Warning: Cannot modify header information - headers already sent by (output started at /home/andreyp/public_html/wp-content/plugins/all-in-one-seo-pack/aioseop.class.php:221) in /home/andreyp/public_html/wp-content/themes/medical-active/quote-form/pmi-brain.php on line 79 I've disabled the plugin that was causing it but still no luck. Is there a basic function that will just call thank you page url to open in separate window? Thank you
This error is usually because you have this code below the DOCTYPE tag and the <head> tag. If true, move it above those. Should be easy since there are no echo statements built in.
Make sure you have nothing outputting to the browser prior to your redirect. Even whitespace. that will cause the headers to break. or turn on output buffering before you redirect. <?php ob_start(); header("Location: ".get_bloginfo('url').'/thankyou/'); ob_end_flush(); Code (markup):