Cannot modify header information - headers already sent by Php ERROR

928

Error Is showing in the Header(location......). the error is in the same line where header('location:companies.php?rates=1'); is written

"DestinationState"  => $_SESSION['order'][$counter]['t_stateID'],
    "DestinationZipcode"=> $_SESSION['order'][$counter]['t_zipcode'],
    "Details"           => array('DetailItem' => array( 'Weight' => $_SESSION['order'][$counter]['weight'],'Class' => '55')),
    "Accessorials"      => array('AccessorialItem' => array('Code' => 'LiftgateService')),
    "CODAmount"         => "100",
);

//print('<pre>');print_r($params);die;
   $return = $client->Create(array('request'=>$params));
  // $return = $client->Create($params);
   //$return  = $client->__call('Create', $params);
   //print('<pre>');print_r($return);die;
   $counter=0;
   $_SESSION['Saia'][$counter]['Amount']  = $return->CreateResult->RateDetails->RateDetailItem->Amount;

}
}
}   


header('location:companies.php?rates=1');
?>
841

Answer

Solution:

Add this to your first line:

<?php ob_start();?>
120

Answer

Solution:

Try removing all the leading spaces before header(). Usually there is at least one in the html of the page. I don't see the beginning of the page so I can't help you more.

People are also looking for solutions to the problem: php - Update another entity field in current entity

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.