hey all.
I am trying to do validation via PHP for submitted forms. Below is my own code, please comment if its the correct method or not.
However, I tried so many ways to have the /n or /r added, but I cant get to it.
Its just to make a new paragraph. Currently, it does the validation, but once I hit the enter key twice, for a new paragraph, it doesnt work the way it should.
Any help and advice appreciated.
Thanx
function validateText($data){
//if it's NOT valid
if(ereg('[^a-zA-Z0-9 .,-_]', $data))
return false;
//if it's valid - Must contain only alphabetical characters a-z, numerical numbers 0-9, spaces, commas, fullstops, dashes and underscores (abc123 ,._-)
else
return true;
}