Forum Moderators: coopster
function clean($string)
{
$c_string[250] = $string;
$x = 0;
while($x <= 250)
{
if($c_string[x] == "<" ¦¦ $c_string[x] == ">")
{
echo "Your entry/username contained illegal characters!";
exit();
}
$x++;
}
}
if you don't care about the legnth (250)
function clean($string) {
if ((ereg("<",$string)) ¦¦ (ereg(">",$string))) {
echo "Your entry/username contained illegal characters!";
exit();
}
}
function clean($string) {
for($x=0,$x<=250;$x++){
if(($string[x] == "<") ¦¦ ($string[x] == ">")) {
echo "Your entry/username contained illegal characters!";
exit();
}
}
}
should be
function clean($string) {
for($x=0,$x<=250;$x++){
if(($string[$x] == "<") ¦¦ ($string[$x] == ">")) {
echo "Your entry/username contained illegal characters!";
exit();
}
}
}