note 61500 deleted from function.str-replace by bjori

From: Date: Sun, 26 Mar 2006 22:19:19 +0000
Subject: note 61500 deleted from function.str-replace by bjori
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-106663@lists.php.net to get a copy of this message
Note Submitter: info at hp4 dot dk ---- If you have a tagwall on you site and a user write "<" or ">" You script will go to shit not work ;) You can use this code to remove "<" and replace it whit &gt; $name = $_POST["name"]; $mail = $_POST["mial"]; $text = $_POST["text"]; $search_keys = array("$name","$mail","$text"); //This is here you control where php shall search after the search word $keys = array("<",">","<BR>"); //This is here you control the search word $key_replace = array("&lt\;","&gt\;","&lt\;BR&gt\;"); //This is the 'word' or 'code' the search word will be replacet whit $special_keys = str_replace("$search_keys","$keys","$key_replace"); //Here we onlye set it in to the php finction :) Good Luck

« previous php.notes (#106663) next »