Re: [PHP] validating using php

2008-05-14 Thread Iv Ray
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.

[PHP] validating using php

2008-05-13 Thread Sudhakar
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.="Please enter your address "; } as part of the form the user has to fill in their name, assuming if the user