RE: [PHP] Searching a string or similar

From: Date: Fri, 28 Dec 2001 19:20:35 +0000
Subject: RE: [PHP] Searching a string or similar
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-78964@lists.php.net to get a copy of this message
This should be a better alternative: http://www.php.net/manual/en/function.strip-tags.php -----Original Message----- From: Bogdan Stancescu [mailto:mgv@fx.ro] Sent: Friday, December 28, 2001 11:14 AM To: Ash Cc: php-general@lists.php.net Subject: Re: [PHP] Searching a string or similar if (strpos("<SCRIPT LANGUAGE = Javascript>",$input_string)===false) { echo("Yeah, right!"); exit; } You'll have a lot of problems, though, because 1. You also need to check for <script type="text/javascript">; 2. You have to strtolower() both strings in order to eliminate capitalization differences; 3. and the tougher: how do you check for this one: "<script language ='javascript' \t>", where "\t" is a tab character? And obviously all the possible combinations... Bogdan Ash wrote: > Hi i've taken a look throught he manual and i can't find a function to do > this > > Basically i want to take in a string and check that the string doesn't > contain a certain word or something > > ie check that it doesn't contain <SCRIPT LANGUAGE = Javascript> to prevent > hackers/crackers on my guestbook > > Thanks > > Ash > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#78964) next »