Jump to content

Archived

This topic is now archived and is closed to further replies.

Terfanda

Form Validation

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






Share this post


Link to post
Share on other sites
[!--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?

Share this post


Link to post
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))))


Share this post


Link to post
Share on other sites

×

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.