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

confused by ecart error on checkout

Thread began 4/30/2012 7:31 pm by Christopher West | Last modified 5/01/2012 3:31 pm by Jason Byrnes | 651 views | 5 replies |

Christopher WestCommunity Expert

confused by ecart error on checkout

Hi, I was just going through the pages on my website. I had logged in as an admin. (this test was after just logining in (so not adding anything to cart so thats empty).

if I were to go to the checkout page (which gives me access once logged in) I get the following error message at the top of my site:

Warning: Cannot modify header information - headers already sent by (output started at /homepages/28/d402258082/htdocs/projects/dinky/checkout.php:80) in /homepages/28/d402258082/htdocs/projects/dinky/checkout.php on line 101


I checked onthe checkout.php file and the line in question relates to:

<?php
// WA eCart Redirect
if ($DinkyCart->redirStr != "") {
header("Location: ".$DinkyCart->redirStr);
}
?>

I just wanted an understanding of this error message so that I can fix it - as obviously dont want customers to see error messages like this if they were to login and snoop to the checkout page without ordering anything to the cart.

kind regards

Chris

Sign in to reply to this post

Jason ByrnesWebAssist

the headers already sent error message is caused by output to the page between php code blocks.

see this thread for details:
showthread.php?t=19285

Sign in to reply to this post

Christopher WestCommunity Expert

Hey Jason, thanks, I checked out the link and then went back to my code and there werent any spaces. However I tried something else. I had 4 code blocked together down the page and decided to move them to the top of the page - 2 code blocks were automated by ecart and the other 2 were session variables I created (my session variables were before the ecart code blocks) I uploaded did the exact same tests as before and this time success the problem is gone :) but I would like to find out more why in the thread you gave me that spaces would also cause this error - and why did my method fix the problem (unless somehow by me moving the code blocks to the top i somehow had space or line breaks before and so now i dont. its all very confusing but interesting :)

Sign in to reply to this post

Jason ByrnesWebAssist

the error is caused by any output between code blocks that comes before the session_start() or header() functions.

a space is output,

so is a blank line

so is an html comment or HTML code.

the only thing I can say about the change you made, is that it removed the output that was causing the error. I cant really tell why without seeing the original code in the original PHP file.

Sign in to reply to this post

Christopher WestCommunity Expert

well you made me re look at my code so thats what helped in fixing the issue. im wondering if you would be at all interested in seeing the before and after files to see for yourself. as i would be interested myself to find out from you if I had missed out something, but then without knowing fixed it.

Sign in to reply to this post

Jason ByrnesWebAssist

if you need specifics on what caused the error, i would need a copy of the original page, no need to send the fixed page.

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...