Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_php thread: Shopping Cart Case Study


Message #1 by "jim" <kslim@l...> on Tue, 16 Jan 2001 17:30:40 -0000
Hi Grant
Thanks that was a big help I checked for white space in the register file
and the functions file but forgot all about the common.inc file.
jim


-----Original Message-----
From: Grant Ballard-Tremeer [mailto:grant@e...]
Sent: Tuesday, January 16, 2001 10:13 AM
To: professional php
Subject: [pro_php] Re: Shopping Cart Case Study


Hi Jim

The first thing to look for in my opinion when you get these 'Warning:
Cannot 
add more header information...' messages is the very first line and the very

last line of all the relevant files (that's register.php, functions.php and 
common.inc - the latter two appear to be included with the require 
statement). Make sure that *nothing* comes before the <?php tag and
*nothing* 
after ?> in each file. A space or newline will be enough to send headers 
which, once sent, will cause the problem you have in line 47. If you can't 
see any try deleting any possible spaces just the same ;->

If that doesn't solve the problem you'll have to work through the code and 
see if anything is being output. What I sometimes do is gradually comment
out 
sections of the code until the problem (hopefully) goes away... then I at 
least know where the isn't. 

Hope this helps
Grant

On Tuesday 16 January 2001 17:30, you wrote:
> I have been trying to run he shopping cart case study from the php
> programming book but each time i try to enter a new user when the file
> goes to the register.php page I get an error message.
>
> The code in the register.php page has a problem with it.  the
> header()sections to call the error pages and for the redirection to the
> successful page are causing the following error output.
>
> Warning: Cannot add more header information - the header was already sent
> (header information may be added only before any output is generated from
> the script - check for text or whitespace outside PHP tags, or calls to
> functions that output text) in
> /home/sites/site16/users/lateral/web/shop/register.php on line 47
>
> does anyone have any ideas?
>

  Return to Index