Terfanda Posted June 18, 2006 Share Posted June 18, 2006 *************************************************************************function emailcheck($Email) { $theresults = ereg("^[^@ ]+@[^@ ]+\.[^@ \.]+$", $intext, $trashed); if ($theresults) { $isamatch = TRUE; } else { $isamatch =FALSE; } return $ismatch; } function HandleForm() { $Name=$_POST['fname']; $FamName=$_POST['lname']; $Email=$_POST['mailaddress']; $TheDate=date("j F Y H:i:s"); $acc=emailcheck("$Email") if(($Name=="" OR FamName=="")OR((eregi("^[a-zA-Z]+$",$Name)) OR (eregi("^[a-zA-Z]+$",$FamName)))) { $acc=FALSE; } else { $acc=TRUE; } if ($acc==TRUE) { $CallFunction=WriteToFile("$Name","$FamName","$Email","$TheDate"); } else { print("Please enter a valid Input !\n"); } } *************************************************************************************** this 2 function should check for if the user has enter his name and last name and if he didnt put nay number in them and the email check if the user has enter a valid email syntax these are what they are supposed to do but they are giving error if anyone can help me i will be greatfull and thank you in advance if anyone has a simpler way to check for an email and the name last name input and would like to tell me i am again thankfullSorry The Error is here : Parse error: parse error if(($Name=="" OR FamName=="")OR((eregi("^[a-zA-Z]+$",$Name)) OR (eregi("^[a-zA-Z]+$",$FamName)))) Quote Link to comment https://forums.phpfreaks.com/topic/12307-form-validation/ Share on other sites More sharing options...
.josh Posted June 18, 2006 Share Posted June 18, 2006 [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--] these are what they are supposed to do but they are giving error [/quote]mind telling us what the error is? Quote Link to comment https://forums.phpfreaks.com/topic/12307-form-validation/#findComment-47008 Share on other sites More sharing options...
Terfanda Posted June 18, 2006 Author Share Posted June 18, 2006 [!--quoteo(post=385328:date=Jun 18 2006, 07:28 PM:name=Crayon Violent)--][div class=\'quotetop\']QUOTE(Crayon Violent @ Jun 18 2006, 07:28 PM) [snapback]385328[/snapback][/div][div class=\'quotemain\'][!--quotec--]mind telling us what the error is?[/quote]Sorry The Error is here : Parse error: parse error if(($Name=="" OR FamName=="")OR((eregi("^[a-zA-Z]+$",$Name)) OR (eregi("^[a-zA-Z]+$",$FamName)))) Quote Link to comment https://forums.phpfreaks.com/topic/12307-form-validation/#findComment-47056 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.