I am making a user-interface page like the one in that forum. So i don;t want my users be able to write html tags in the textarea!!
Is that practicable?
that's pretty tough to do that, you'd need plenty of javascript
better convert the typed code, for example with htmlspecialchars()
does this function search throughout the text for such html chars?
example:
$string = "<hr>"; $new = htmlspecialchars($string); echo $new; // prints <hr>
so - yes, it replaces each
$string = "<hr>"; $new = htmlspecialchars($string); echo $new; // prints <hr>
🙂
Everything to be treated as a charachter < , h , r, >
yeah, it prints <hr> in a browser, but that's the intention, since it would normally draw a horizontal line a quick view in the source code shows that it prints <hr> :p
and this is the intention, isn't it? to disallow execution of html-tags