Hi, I recently made a news update page for my website and noticed whenever I use html in the news update it prints it out on the news page instead of doing what the html is meant to do (ie. <img src="banana"> echo's that txt instead of the image of a banana) anyone know a site with an example script of a php parser that can recognize the html tags or know where I might find a tutorial for one? If not html does anyone know how to do the BBCode like on these forums, that also would be cool. Sorry if I sound like a complete newbie, but in all honesty I am.
Thanks! Branden.
Mysql to html Php parsing
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
I would guess that your code uses htmlspecialchars() or its sibling htmlentities().. that's a good thing. You don't want people to be able to post HTML willy-nilly.
There are various tools for keeping posted HTML safe. HTML Purifier is one of the more robust. If you want down and dirty there's strip_tags() and similar functionality.
As far as bbcode goes, there are many options.. some of which have been posted about previously -- search for them if interested. There's also Wikiwiki style syntax too. I've posted a basic parser previously: viewtopic.php?t=70453
There are various tools for keeping posted HTML safe. HTML Purifier is one of the more robust. If you want down and dirty there's strip_tags() and similar functionality.
As far as bbcode goes, there are many options.. some of which have been posted about previously -- search for them if interested. There's also Wikiwiki style syntax too. I've posted a basic parser previously: viewtopic.php?t=70453