Jump to content

Form Validation


Terfanda

Recommended Posts

*************************************************************************
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 thankfull


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))))






Link to comment
Share on other sites

[!--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))))


Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.