Page 1 of 1

Error occurring with HTML formatting...

Posted: Tue Mar 25, 2003 6:11 pm
by Clagnut
Hi, I'm a bit of a newbie here but I have created my entire website using PHP and MySQL with the help of the book 'PHP and MySQL Web Development'. The site works entirely apart from one annoying error.

Whenever the user fills out a form wrong an error message appears, as you would expect. Unfortunately, the error message has no formatting and so appears in Times Roman on a white background; not like the rest of the site at all. If I try and add formatting to the page containing the error message, I get an error e.g. "Warning: Cannot send session cache limiter - headers already sent (output started at /diskh/zco/cocdb/public_html/change_passwd_form.php:6) in /diskh/zco/cocdb/public_html/change_passwd_form.php on line 8"

Where change_passwd_form.php looks like this:

<HTML>
<BODY BGCOLOR=#4682B4>
<FONT FACE=Arial COLOR=#FFFFFF>


<?
require_once("bookmark_fns.php");
session_start();

check_valid_user();

display_password_form();


?>

</BODY>
</HTML>

If I remove the HTML I get no error message, but unformatted text from the output.

Is there something obvious I'm missing (maybe to do with the session?) and if so, is there a way of formatting the page without the HTML code i.e. from inside the PHP script?

Many many thanks.

Posted: Tue Mar 25, 2003 6:37 pm
by Clagnut
Ah, just looked at the header 'sticky' on the front page - apparantly all newbies make this mistake! I've sorted it now.

Thanks anyway, and I'll read the stickies more closely next time!

Posted: Tue Mar 25, 2003 7:53 pm
by m3mn0n
Anytime! :)