Jump to content
GSForum - Segélyvonal

input


skyyler

Recommended Posts

Posted

halloh:)

 

Az lenne a kérdésem, hogy hogy csináljak olyan inputot, amibe nem lehet html kódokat írni (esetleg textarea vagy valami). Mert text adatbázisú chatem van, és iframe-mel illesztem be a txt fájlt ahova formmal postolom az inputos cuccokat (név, üzenet) és van, amikor olyanokat csinál valaki, hogy html kódot beleír az inputba, és akkor mondjuk betesz egy alert ablakot. :D Vicces dolog, de azt szeretném hogy ne lehessen.

 

<form name="form1" method="post" action="chat.php">
Neved: <input name="nick" type="text" id="nick">
Üzenet: <input name="uzenet" type="text" >
<input type="submit" name="Submit" value="Üzenek!">
<input name="ido" type="hidden" id="data" value="<? echo (date("h:i")); ?>">
</form>

Így néz ki a html része a chatnek. Ha tudnátok segíteni akkor legyetek szívesek. :)

Posted

Pl. a php-s "strip_tags" paranccsal kigyomlálhatod belõle a html tag-eket. (http://hu.php.net/strip_tags)

 

Ha félreértettem és mégse ilyesmire gondoltál, akkor szólj nyugodtan :)

Kovács Dávid ( Davs )
Posted
$text=$_POST["text"];
$text=str_replace("<","<",$text);
$text=str_replace(">",">",$text);

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...