ballhogjoni Posted April 10, 2007 Share Posted April 10, 2007 can someone help me with this: Warning: Cannot modify header information - headers already sent by (output started at /home/realfina/public_html/ec/checkout/header.php:4) in /home/realfina/public_html/ec/checkout/dcc_process.php on line 174 this is my code { $first = rawurlencode($_SESSION['FIRSTNAME']); $last = rawurlencode($_SESSION['LASTNAME']); $email = rawurlencode($_SESSION['BuyerEmail']); $phone = str_replace('-','',$_SESSION['PHONE']); $address = rawurlencode($_SESSION['STREET1']); $city = rawurlencode($_SESSION['CITYNAME']); $state = $_SESSION['STATEORPROVINCE']; $zipcode = rawurlencode($_SESSION['POSTALCODE']); $username = 'xxxx'; $password = 'xxxx'; $command = "user.configure"; $user_id = "NEW"; $url = "https://www.xxx.com/auto/api.php?partner_login=$username&partner_password=$password&test=TRUE&command=$command&user_id=$user_id&service=\"code=DS,frequency=M,action=add,renewal_billed_to=U,trial=7\"&output=php&phone=$phone&first_name=$first&last_name=$last&bill_address1=$address&bill_address2=&bill_city=$city&bill_state=$state&bill_postal=$zipcode&bill_country=US&username=foousername&password=foopassword&cc_num=$CreditCardNumber&cc_exp=$ExpYear-$ExpMonth&email=$email"; ob_start(); $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL , $url); //the url $ret = curl_exec($ch); /*curl_setopt($ch, CURLOPT_FAILONERROR, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);// allow redirects curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // return into a variable curl_setopt($ch, CURLOPT_TIMEOUT, 3); // times out after 4s curl_setopt($ch, CURLOPT_POST, 1); // set POST method */ curl_close($ch); ob_end_clean(); mysql_query("UPDATE address SET Status=2 WHERE IPAddress='{$_SESSION['IPAddress']}'"); header("Location:https://xxxx.com/ec/checkout/order_complete.php"); } Quote Link to comment https://forums.phpfreaks.com/topic/46443-solved-modify-header-information-problem/ Share on other sites More sharing options...
monk.e.boy Posted April 10, 2007 Share Posted April 10, 2007 header stuff needs to be the first thing the browser sees, so header() must come before any echos, prints or error messages. Try using the @ to suppress error messages. monk.e.boy Quote Link to comment https://forums.phpfreaks.com/topic/46443-solved-modify-header-information-problem/#findComment-225905 Share on other sites More sharing options...
ballhogjoni Posted April 10, 2007 Author Share Posted April 10, 2007 instead of using the header function I just echoed "<html><head><meta http-equiv=\"refresh\" content=\".0;url=https://xxxxx.com/ec/checkout/order_complete.php\"></head><body></body></html>"; that worked just fine. Quote Link to comment https://forums.phpfreaks.com/topic/46443-solved-modify-header-information-problem/#findComment-225918 Share on other sites More sharing options...
wildteen88 Posted April 10, 2007 Share Posted April 10, 2007 You have output on line 4 in header.php which is causing this error. Not line 174 from dcc_process.php header stuff needs to be the first thing the browser sees, so header() must come before any echos, prints or error messages. Try using the @ to suppress error messages. monk.e.boy Suppressing errors doesn't mean the code will then work. As all you will get is a white screen Quote Link to comment https://forums.phpfreaks.com/topic/46443-solved-modify-header-information-problem/#findComment-225933 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.