Scott S.
|
| Posted: 03/27/2002, 10:48 AM |
|
I get the following error:
Warning: Cannot add header information - headers already sent by (output started at c:\foxserv\www\ut\dndchardb\login.php:38) in c:\foxserv\www\ut\dndchardb\login.php on line 181
When I put simple code in the Open Any Page part of Modules.
Im basically trying to put a logo on my pages.
So this is the code I put in:
echo "<BR><img src=images/D20_logo.jpg><BR>";
I also tried putting an img tag (by doing a ?> <img......> etc.
This is line 181 that is referred to above:
header("Location:" . $sFileName . "?ret_page=" . urlencode(get_param("ret_page")));
Line 38 referred to above is my custom code.
So I interpret this as meaning that it cant set the headers because I have already output HTML to the browser... Well... OK... So then... whats a better way to do this (put a logo on my pages)? Of course I dont want to have to paste code into each page, and I also may not want the logo on all my pages..... :)
by the way, I am very impressed with codecharge so far!! GREAT PRODUCT
|
|
|
 |
Nicole
|
| Posted: 03/28/2002, 12:39 AM |
|
Scott,
I guess you get the error when submit any form (e.g. Record). I hope, the explanation will clear the reason. When form is submitted it goes to the same page and formname_action() function is executed. Lets say the record is updated. While it is done user s redirected to any other page with the help of
header("Location: pagename.php");
code. header() function should be executed before any output was made on the page, otherwise redirection fails and you get the warning.
In your case warning is caused by "echo". The workaround is to put image to header (or footer) section of Header page. Or the more complex solution is to put "echo" manually to Open event of each page. In case Login, Tree, Record forms are present on the page the code should be like:
$sForm = get_param("FormName");
if ($sForm == "")
echo "<BR><img src=images/D20_logo.jpg><BR>";
|
|
|
 |
|