Sudhakar wrote:
if( strlen(trim($name) == 0 ) || !preg_match('/^[a-zA-Z ]+$/x', $name) )
{
$error.=Name is blank or has special characters ;
}
You have messed up the brackets. This -
strlen(trim($name) == 0 )
should be -
strlen(trim($name)) == 0
Then the script does what you want.
Iv
thanks to everyone for providing the solution for validating textarea using
php i have used the following and it worked
$add = trim($_POST[add]);
if(strlen(trim($add)) == 0 )
{
$error.=brPlease enter your address ;
}
as part of the form the user has to fill in their name, assuming if the user
2 matches
Mail list logo