PDA

View Full Version : If < found in input...error message shown


andyatkins46
08-21-2005, 09:26 PM
Hey guys,

Hopefully this will be an easy one for someone out there... :)

Ive been using str_replace to get rid of < and >'s in the past but now I want to display an error message if < or > is detected in an input...

Find below a brief example of what I mean....obviously its the top line I need the code for...

If $bob contains < or > :
echo ("Error");
else:
echo ("Accepted");
endif;


Thanks in advance,

Andy

NancyJ
08-21-2005, 09:34 PM
strpos (http://uk2.php.net/manual/en/function.strpos.php)

andyatkins46
08-21-2005, 10:07 PM
Thanks Nancy! :)