You are not logged in.
Pages: 1
Why does this not work I'm guess I'm missing something.
Using these examples I found.
$userInput = "I am going to hax0r your site, hahaha!
<script type='text/javascript'>
window.location = 'http://www.example.com/'
</script>'";
$userInputEntities = htmlentities($userInput);
echo $userInputEntities;
$str = "A 'quote' is <b>bold</b>";
echo htmlentities($str);
$new = htmlspecialchars("<a href='test'>Test</a>", ENT_QUOTES);
echo $new;
Now running on cli with php.
<script type='text/javascript'>
window.location = 'http://www.example.com/'
</script>'A 'quote' is <b>bold</b><a href='test'>Test</a>
Works fine yet through apache its not working, could some one point me in the direction to look, to solving why.
Offline
eh i didn't really understand what your problem is, but the $new = .. echo $new should output this:
<a href='test'>Test</a>
edit: dmmit the forum replaces the html entity of the single quote, instead of the single quotes you should actually get '''
Last edited by Eliteforce (2008-03-22 21:25:35)
Offline
Pages: 1