FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a 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
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

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