im using preg_match to watch for chracters i dont want in my forum. When ever i make a new line the the textarea and choose post it will error out because it found a chracter that im not allowing.
Here are the tests that happen.
function test_field( $value , $field_name ,$preg_test ){
if(!$value){
return '<TR><TD>:: '.$field_name.' was left Blank. Please enter it below.</TD></TR>';
}
else{
preg_replace($preg_test,$value);
return '<TR><TD>:: '.$field_name.' has Invalid characters! Valid characters are A-Z, 0-9 and punctuation with the exception of quotes!</TD></TR>';
}
return '';
}
function test_newthread($one, $two, $three){
global $error_string;
$error_string .= test_field( $one , 'Thread Name' , '/[^a-z0-9 \,\/\=&\[\.!\]\?:@$%()]/i' );
$error_string .= test_field( $two , 'Thread Subject' , '/[^a-z0-9 \,\/\=&\[\.!\]\?:@$%()]/i' );
$error_string .= test_field( $three , 'Your Message' , '/[^a-z0-9 \,\/\=&\[\.!\]\?:@$%()]/i' );
return $error_string;
}
I can wright a book and nothing will happen but as soon as i hit enter for a new line and choose post it will error.
Any ideas on why it wont let me creat a new line in the text field?