0

Hello,

I'm having a weird problem with some PHP when outputting some HTML. For example:

echo "<h1>There are errors!</h1>";
foreach($errors AS $error)
{
    echo $error . '\n';
}
exit();

I want the output to actually show the text in H1 style, however the output is like this:

<h1>There are errors!</h1>

In other words, it isn't processing the HTML.

Any suggestions?

4
Contributors
3
Replies
4
Views
5 Years
Discussion Span
Last Post by broj1
0

The page you are echoing it on, should have the basic html tags too like :

<html>
<head></head>
<body></body>
</html>

And echo it in the body. I hope this helps.

0

I get the text displayed as H1 (Firefox 12 on Fedora 16). Maybe you should have a look at the HTML code that your browser displays and see if there are any errors elsewhere (right click on page and select View page source in Firefox).

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.