Forum Moderators: phranque

Message Too Old, No Replies

XHTML tags not working in PhpBB forums

         

lohia anirudh

9:23 am on Jun 12, 2007 (gmt 0)

10+ Year Member



Hi,

I am running a PhpBB forums on my site and there are lot of xhtml tags that does not work on the forums like <br /><hr />. The outcome of this is that the page has lot of HTML validation errors.

Please help.

Regards,
Anirudh

bill

9:50 am on Jun 12, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Can't you just run the forum in an XHTML template? Maybe I'm not sure of the nature of your problem. Where are these tags showing up? Are you importing the forum info to other parts of your site?

g1smd

8:19 pm on Jun 12, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Does the page have an XHTML DOCTYPE?

Perhaps you only need to use HTML codes instead?

lohia anirudh

5:51 am on Jun 13, 2007 (gmt 0)

10+ Year Member



yes the doc type is XHTML. will it be a good idea to change my doc type to HTML4.0?

Anirudh

thecoalman

6:42 am on Jun 13, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Which version? I'm assuming you are using phpbb2 because the stock templates in phpbb2 use <hr /> and <br /> with a HTML doctype, switching doctypes won't help because other code won't validate as XHTML. Not sure what the reasoning is, I vaguely remember reading something about it once.

bill

8:35 am on Jun 13, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



If the DOCTYPE is XHTML, why are you receiving validation errors for valid XHTML tags? I'm confused.

lohia anirudh

3:50 am on Jun 14, 2007 (gmt 0)

10+ Year Member



If the DOCTYPE is XHTML, why are you receiving validation errors for valid XHTML tags? I'm confused.

When the DOCTYPE is XHTML it doesnt give me any validation errors but the XHTML tags are not working in my forums.like when I write <hr /> it doesn't draw any horizontal line but simply using <hr> works.

Which version? I'm assuming you are using phpbb2 because the stock templates in phpbb2 use <hr /> and <br /> with a HTML doctype, switching doctypes won't help because other code won't validate as XHTML. Not sure what the reasoning is, I vaguely remember reading something about it once.

I am using PHP Version 4.4.6

Regards,
Anirudh

bill

4:36 am on Jun 14, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Which version of phpBB are you using?

lohia anirudh

6:04 am on Jun 14, 2007 (gmt 0)

10+ Year Member



I am using phpBB 2.0.22

bill

6:43 am on Jun 14, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



When the DOCTYPE is XHTML it doesnt give me any validation errors but the XHTML tags are not working in my forums.like when I write <hr /> it doesn't draw any horizontal line but simply using <hr> works.

After reading this several times I might be getting it to some degree. You're saying that if you use XHTML tags in forum posts they don't work? That makes some sense. It's kind of like the [bb] code many forum packages use. The forum's internal systems convert what you post into the final page.

Am I understanding the issue?

thecoalman

7:22 am on Jun 14, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Well if what was suggested above is what you are getting at, using them in posts....

I did a test post on my test forum and using <hr> produces a line , usng <hr /> produces a line but the trailing slash is deleted by the forum. If you go to edit the post it has been removed. To change this behavior you would have to edit the php script, you might find something on the phpbb forums for doing this.

Whatever the case direct HTML input (even the limited HTML in phpbb2) is a security risk and should not be used for a public forum, it isn't even an option in phpbb3. Check the modifications forums on phpbb.com, they have BB code mods that will add the <hr> tag.

lohia anirudh

8:45 am on Jun 14, 2007 (gmt 0)

10+ Year Member



Yes Bill thats the issue