skyyler Posted January 11, 2008 Posted January 11, 2008 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. 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.
IceTac Posted January 11, 2008 Posted January 11, 2008 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 January 11, 2008 Posted January 11, 2008 $text=$_POST["text"]; $text=str_replace("<","<",$text); $text=str_replace(">",">",$text);
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now