disabling HTML tags in textarea?
Posted: Thu Nov 27, 2008 12:10 pm
I want to know how to disable html tags in a textarea, for example if you type this:
it wont show anything when i submit it since the browser will detect it as an html command
its for a comment system, and Im no professional with php
this is what im using:
and it is recieved, in the next page, and printed like this:
that WILL display the text, but it will let the user use html tags, and that will definitly lead to someone playing with the layouts, or even using php
im not asking for BBcode or anything(unless you know how!
), but i just want to let the user use html tags without actually using html
EDIT:
also, i wanna know how to automatically detect linebreaks, because in the editor even if you press enter a million times, all the text will be on one line
Code: Select all
<Hey whats up?>its for a comment system, and Im no professional with php
this is what im using:
Code: Select all
<form action='blahblah.blahblah'>
<textarea cols="43" rows="11" name='blahblahblah'></textarea>
<input type='submit'>
</form>Code: Select all
$text=S_POST['blahblahblah'];
echo "$text";im not asking for BBcode or anything(unless you know how!
EDIT:
also, i wanna know how to automatically detect linebreaks, because in the editor even if you press enter a million times, all the text will be on one line