Page 1 of 1

PHP & HTML links,images,etc.

Posted: Fri Sep 19, 2008 2:15 pm
by BETA
Ok im here again with this... for my news system.
I have it working right.
But i came to this point where security is ruining functionallity. :|
Let's say i have this $message = $_POST['message'];
and message is:
<a href="#">link</a>
Then it is well displayed as normal html and it is saved in DB as is.
But when using:
$message = mysql_real_escape_string($_POST['message']);
and message is:
<a href="#">link</a>
output looks correct like a normal link but its route is
http://www.otakunosekai.es/noticias/\"#\"
and it is saved in DB as <a href=\"#\">link</a>
so link doesn't work...
Any ideas?

Thx in advance guys!

Re: PHP & HTML links,images,etc.

Posted: Sat Sep 20, 2008 2:32 am
by BETA
Ok i managed to figure out a solution :P
Stripslashes() when outputting did the work.
Thx anyway!