|
Posted by Oli Filth on 11/15/05 15:21
John wrote:
> On 15 Nov 2005 04:14:31 -0800, "Oli Filth" <catch@olifilth.co.uk>
> wrote:
>
> >" Remember that header() must be called before any actual output is
> >sent, either by normal HTML tags, blank lines in a file, or from PHP.
> >It is a very common error to read code with include(), or require(),
> >functions, or another file access function, and have spaces or empty
> >lines that are output before header() is called. The same problem
> >exists when using a single PHP/HTML file."
> >
> I have read that section a number of times and still don't understand
> it.
>
> OK so I use this and get the error message - headers already sent.
>
> <?php header("Location: $page"); ?>
>
> So what do I do now?
>
Is there any whitespace before your <?php delimiter?
e.g.
===== VERY TOP OF FILE =====
1:
2: <?php
3: /* some code here */
4: ?>
5:
6: <?php header("Location: $page"); ?>
....
The blank lines on lines 1 and 5 would cause header not to work.
The following would also cause a problem:
===== VERY TOP OF FILE =====
1: <HTML>
2: <?php header("Location: $page"); ?>
....
--
Oli
Navigation:
[Reply to this message]
|