/ Validation /
function check_field1($reference)
{
if(!preg_match("/[a-zA-Z0-9.-\Ä\ä\Ö\ö\Ü\ü\
]+$/s",$reference))
return TRUE;
else
return FALSE;
}
function check_field2($amount)
{
if(!preg_match("/[0-9\ ]+$/",$amount))
return TRUE;
else
return FALSE;
}
function check_field3($name)
{
if(!preg_match("/[0-9]+$/ ",$name))
return TRUE;
else
return FALSE;
}
function check_field4($cardtype)
{
if(!preg_match("/[0-9]+$/ ",$cardtype))
return TRUE;
else
return FALSE;
}
function check_field5($cardnumber)
{
if(!preg_match("/[0-9]+$/ ",$cardnumber))
return TRUE;
else
return FALSE;
}
function check_field6($exp)
{
if(!preg_match("/[0-9]+$/ ",$exp))
return TRUE;
else
return FALSE;
}
function check_field7($cvc2)
{
if(!preg_match("/[0-9]+$/ ",$cvc2))
return TRUE;
else
return FALSE;
}
function check_field8($ssn)
{
if(!preg_match("/[0-9]+$/ ",$ssn))
return TRUE;
else
return FALSE;
}
function check_field9($address)
{
if(!preg_match("/[0-9]+$/ ",$address))
return TRUE;
else
return FALSE;
}
function check_field10($city)
{
if(!preg_match("/[0-9]+$/ ",$city))
return TRUE;
else
return FALSE;
}
function check_field11($state)
{
if(!preg_match("/[0-9]+$/ ",$state))
return TRUE;
else
return FALSE;
}
function check_field12($zip)
{
if(!preg_match("/[0-9]+$/ ",$zip))
return TRUE;
else
return FALSE;
}
function check_field13($email)
{
if(!preg_match("/[0-9]+$/ ",$email))
return TRUE;
else
return FALSE;
}
function check_field14($phone)
{
if(!preg_match("/[0-9]+$/ ",$phone))
return TRUE;
else
return FALSE;
}
/ Validation /
$error=0; // check up variable
/ get it checking /
if(!check_field1($reference))
{
echo "Illegal input $reference in 'Reference'";
$error++; // $error=$error+1;
}
if(!check_field2($amount))
{
echo "Illegal input $amount in 'Amount'";
$error++;
}
if(!check_field3($name))
{
echo "Illegal input $name in 'Name'";
$error++;
}
if(!check_field4($cardtype))
{
echo "Illegal input $cardtype in 'Cardtype'";
$error++; // $error=$error+1;
}
if(!check_field5($cardnumber))
{
echo "Illegal input $cardnumber in 'Cardnumber'";
$error++; // $error=$error+1;
}
if(!check_field6($exp))
{
echo "Illegal input $exp in 'Exp'";
$error++; // $error=$error+1;
}
if(!check_field7($cvc2))
{
echo "Illegal input $cvc2 in 'CVC2'";
$error++; // $error=$error+1;
}
if(!check_field8($ssn))
{
echo "Illegal input $ssn in 'SSN'";
$error++; // $error=$error+1;
}
if(!check_field9($address))
{
echo "Illegal input $address in 'Address'";
$error++; // $error=$error+1;
}
if(!check_field10($city))
{
echo "Illegal input $city in 'City'";
$error++; // $error=$error+1;
}
if(!check_field11($state))
{
echo "Illegal input $state in 'State'";
$error++; // $error=$error+1;
}
if(!check_field12($zip))
{
echo "Illegal input $zip in 'Zip'";
$error++; // $error=$error+1;
}
if(!check_field13($email))
{
echo "Illegal input $email in 'Email'";
$error++; // $error=$error+1;
}
if(!check_field14($phone))
{
echo "Illegal input $phone in 'Phone'";
$error++; // $error=$error+1;
}
if(!check_field15($initals))
{
echo "Illegal input $initals in 'Initals'";
$error++; // $error=$error+1;
}
?>