Error occurring with HTML formatting...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Clagnut
Forum Newbie
Posts: 5
Joined: Tue Feb 25, 2003 8:44 am

Error occurring with HTML formatting...

Post 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.
Clagnut
Forum Newbie
Posts: 5
Joined: Tue Feb 25, 2003 8:44 am

Post 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!
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

Anytime! :)
Post Reply