CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 Open Any Page code causes error!?

Print topic Send  topic

Author Message
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>";

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.