Jump to content

Recommended Posts

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");
}

 

Link to comment
https://forums.phpfreaks.com/topic/46443-solved-modify-header-information-problem/
Share on other sites

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 ::)

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.