Hi, I really like Q.C and would like to integrate it into my website which I'm currently working on. There is just one single problem which I can't solve and it is bothering me. I've designed a website with a header and two menu-colums (there are no frames on the site). One to the left and the other one to the right of the page. I would like to insert Q.C in the middle but I keep getting this error message:
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at D:WebServerhtdocsshop1test.php:5) in D:WebServerhtdocsshop1test.php on line 295
What can I do to get rid of this message?
I'd like to thank everyone for their help (I hope someone can help me) and as soon as this problem is solved and my website is online I will donate some money to Q.C so that this great script wil be avaiable to others for free as well.
QuickCart is using cookies, and that becomes your problem here because session_start() have to be called before anything else is outputted to the browser. In this case (I'm guessing) the top of the page is outputting something to the browser, before it reads session_start(). Solve the problem by createing 2 different sessions. This is done by setting 2 different names with the session_name()-command. Like this: session_name("yourname"); session_start();
Its easy enough to build your website around quickcart using the templating system. search the forums i wrote a tutorial somwhere
I've tryed all sorts of things but I can't get QC to run without an error message. I've put the html-code on my server and whould be extremly greateful if someone would be so kind as to take a look at it for me.
Oh by the way I get the following error messageif I run QC on my local server:
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at D:WebServerhtdocsshop_forumoc.php:9) in D:WebServerhtdocsshop_forumoc.php on line 93
My URL with the HTMl-code is: http://thomaspohl.com/qc/html.htm
Thaks very, very much for your help.
As already stated, session_start() MUST be called before any other output is sent, ie. before all other HTML. There are a couple of other options, besides the one already posited by Bengan. You could move the session_start() from the QC code into a php file that it is the first thing called before your 'framing' code. Or you could buffer your initial HTML output so that it does not get sent before the session_start() in the QC code (an initial PHP file calling ob_start() or ob_start('gz_handler');).
tnx for your help. But as you have probably guessed all ready I#m anything but an expert to do with PHP. But if I understand you correctly this should help: - put <?php session_start( ); ?php> at the top of the website - take the above out of the actual QC-php script
and ' Bob's you uncle' things should work. Or am I getting thing wrong again?
P.S.: I wouldn't mind knowing how to handle your other suggestion but it is asking a bit much. Have you got an idea where I could find more info on that subjact os that I don't have to bother you again?
Hi, I'm really, really sorry to bother you again. But your solution with placing the session_start at the beginning of the website seem to work OK untill I decided to go for a mock order. As soon as I try to click on the button that should take me to the 'customer details' page I get told the following:
Warning: Cannot modify header information - headers already sent by (output started at D:WebServerhtdocswlan-4-alltom.php:8) in D:WebServerhtdocsactions_clientorders.php on line 35
Does anyone know how I could get around this problem? PLEASE, PLEASE help me as I don't know a lot about php but I'm willing to learn. ;-)