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


no html in guestbook





golles
I'm writing my own guestbook, and it is almost finished, but I wondering how How can I stop that people use html and other 'shit' in my guestbook?

so <br>haha would not output as:

haha
but as:
<br>haha

I use a MySQL database to store all information
thanks in advance
Stubru Freak
Code:
$message = htmlspecialchars($message);


And if you want to preserve line breaks (which you probably want):

Code:
$message = nl2br(htmlspecialchars($message));
golles
hey, thanks alot man, that was what I'm looking for Smile
Related topics
Which script language do you like most?
css + html
Basic HTML Introduction
Hey everybody ;) HTML or Blog?
Looking for a free HTML editor with built-in preview
html or forum
HTML tutorial
DJ turntable out of an old mouse
Create Web pages without knowing HTML.
Database Privilege
Guestbook problem. PLEASE HELP!
Guestbook to MKPortal
Html Forms help please?
Guestbook Problems
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.