FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


How to parse a HTML with PHP ?





Philip
Is there a way to check a HTML Pages, all TAGS inside that HTML is already right and not harm full my website using php ?

i know some time user can add open tag like this <a>Stop here <a <- with out >

it make all my text below that tag not viewed by browser.

thanks.
eepman
Try using the html validator to check if your page is correct. You must have an ending > on all of your tags. And many tags need an ending </tag> too.
Philip
how can i check it online ? is it have a function ? also
will there return false for not valid ?
eepman
I'm sorry, I don't know of a way to check code while running. I think you just need to write working code. There might be something out there though. Check on google.
Stubru Freak
Maybe don't let your visitors use html, it's unnecessary anyway in general, and it's annoying if a visitor tries to write: 4 < 5 and he gets strange results.

htmlspecialchars()
Philip
Stubru Freak wrote:
Maybe don't let your visitors use html, it's unnecessary anyway in general, and it's annoying if a visitor tries to write: 4 < 5 and he gets strange results.

htmlspecialchars()


i ought to have my user too edit a page like a kind blog,
so the user can write > < also can make a text to big and bold <B>Big text</B>

but i'm fraid dunno how to fullfill it.
Stubru Freak
Philip wrote:
Stubru Freak wrote:
Maybe don't let your visitors use html, it's unnecessary anyway in general, and it's annoying if a visitor tries to write: 4 < 5 and he gets strange results.

htmlspecialchars()


i ought to have my user too edit a page like a kind blog,
so the user can write > < also can make a text to big and bold <B>Big text</B>

but i'm fraid dunno how to fullfill it.


You can use bbcode like in this forum.

So a user types:
[ b ]Example[/ b ] and you convert it to <b>Example</b>
There really isn't a php function to only allow non-dangerous things in html.
Philip
then how can i using this BBcode ?
Oh yeah i remembered that phpBB using BBCode,

can i uses the phpbb function ?
then how to uses it ?

wew
Rhysige
PHPBB didnt invent bbcode look for "bb class" in google or something..
Philip
Rhysige wrote:
PHPBB didnt invent bbcode look for "bb class" in google or something..



wew, am i need to install any code again ?
somehow i am fraid that i will gain a hard luck on installing that code --"
pollux1er
Normally when you use Notepad ++ to edit your web pages, you can select the language to use so that any mistake can be followed!
Philip
pollux1er wrote:
Normally when you use Notepad ++ to edit your web pages, you can select the language to use so that any mistake can be followed!


I know that, but i ussualy used dreamweaver as my editor Smile
yjwong
For BBCode classes, I think you can check out the PECL and PEAR repositories. To validate HTML, you can use the TIDY functions. Please refer to the PHP Manual for more information.
Related topics
PHP Toturail
IP Address HTML CODE
HTML + PHP problem
Wonders of the include() in PHP.
easyPHP basic questions
.html using header/footer include script?
how did you learn about html, php or other languages???
How to change extension php to html but the php script still
A good place to learn html/php/javascript/etc....
Need a Contact form from HTML/PHP
HTML AND PHP CODER NEEDED ASAP
The best php and html editor?
[help=html,php]Error en forma de contacto...
HTML/PHP Help (Contact Box)
editing webpages (.php or .html) without database/cms?
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.