close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Warning: Cannot modify header information

Thread began 2/05/2012 12:29 pm by Massimo | Last modified 2/07/2012 10:44 am by Jason Byrnes | 657 views | 4 replies |

Massimo

Warning: Cannot modify header information

On cart when try to proceed I get this error:
Warning: Cannot modify header information - headers already sent by (output started at... /httpdocs/siicom_cart.php:5) in .../httpdocs/siicom_cart.php on line 105

This is code in cart.php
...
<?php
//WA eCart Include
require_once("WA_eCart/eCart1_PHP.php");
?>
<?php
$eCart1->GetContent();
?>
<?php
// WA eCart Update
if (isset($_POST["eCart1_Update_100"]) || isset($_POST["eCart1_Update_100_x"])) {
$eCart1->UpdateCart();
$Redirect_redirStr="";
if ($Redirect_redirStr != "") {
$eCart1->redirStr = $Redirect_redirStr;
}
$eCart1->cartAction = "Update";
}
?>
<?php
// WA eCart Continue Shopping
if (isset($_POST["eCart1_Continue_100"]) || isset($_POST["eCart1_Continue_100_x"])) {
$Redirect_redirStr="";
if (true && isset($_SESSION['WAEC_ContinueRedirect'])) {
$Redirect_redirStr=siteToPageRel($_SESSION['WAEC_ContinueRedirect']);
}
if ($Redirect_redirStr != "") {
$eCart1->redirStr = $Redirect_redirStr;
}
$eCart1->cartAction = "Continue";
}
?>
<?php
// WA eCart Clear Cart
if (isset($_POST["eCart1_Clear_100"]) || isset($_POST["eCart1_Clear_100_x"])) {
$eCart1->ClearCart();
$Redirect_redirStr="";
if ($Redirect_redirStr != "") {
$eCart1->redirStr = $Redirect_redirStr;
}
$eCart1->cartAction = "ClearCart";
}
?>
<?php
//WA eCart Redirect Check Out
if (isset($_POST["eCart1_Checkout"]) || isset($_POST["eCart1_Checkout_x"])) {
$Redirect_redirStr="noGatewayCheckout.php";
if ($Redirect_redirStr != "") {
if (isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'] != "") {
if (strpos($Redirect_redirStr, "?") < 0) {
$Redirect_redirStr .= "?".$_SERVER['QUERY_STRING'];
}
else {
$Redirect_redirStr .= "&".$_SERVER['QUERY_STRING'];
}
}

$eCart1->redirStr = $Redirect_redirStr;
}
$eCart1->cartAction = "Checkout";
}
?>
<?php
// WA eCart Redirect
if ($eCart1->redirStr != "") {
header("Location: ".$eCart1->redirStr); **** line 105*****
}
?>


Any idea to resolve?

Sign in to reply to this post

Ian S

Hi

First thing to do is to see if there are any blank spaces or lines between your PHP tags that come before the HTML.

Its difficult to tell this from pasting the code into the forum.

If you have problems locating attach your PHP page to the post.

Cheers
Ian

Sign in to reply to this post

Jason ByrnesWebAssist

like Ian says, it is caused by white space between php tags.

the error is reporting the problem at line 5:
output started at... /httpdocs/siicom_cart.php:5

most likely, there is a blank space at the end of the closing php tag on line 4:
"?> "

see this post for more details on troubleshooting and fixing the headers already sent error:
showthread.php?t=19285

Sign in to reply to this post

Massimo

as you saying it was a simple white space! Thanks

Sign in to reply to this post

Jason ByrnesWebAssist

that is the most likely cause, but i can only guess.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...