Hi,
I created this function
<?php
function username_bad_chars($input) {
$legal_chars_sql = "SELECT * FROM un_legal_chars";
$legal_chars_res = mysql_query($legal_chars_sql);
while($legal_chars_row = mysql_fetch_array($legal_chars_res)) {
$input_new = str_replace($legal_chars_row['char'], "", $input);
}
if($input_new != "") {
return 1;
} else {
return 0;
}
}
?>
The table 'un_legal_chars' contains just one column called 'char' and is populated with letters a thru z and numbers 0 through 9 and _ and one row which is just a space (so that the $input can have a space in it like 'the input'). The idea is that if the $input contains any other characters the function will return 1 (true)... But it ALWAYS returns 1 (true) even if the characters are all in the database. Any suggestions?
Thanks