Graag zou ik dit script:
<?
// de functie
function email_validator($email)
{
if (eregi("^[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,4}$",$email))
{
$valid = "yes";
}
else
{
$valid = "no";
}
return $valid;
}
// je roept hem als volgt aan
$email = "[email protected]";
$check_email = email_validator($email);
if ($check_email == "yes")
{
echo "Het e-mail adres: $email is oke!<p>";
}
else
{
echo "Het e-mail adres: $email is <b>niet</b> oke!<p>";
}
?>
Hij geeft een error op line 50
Parse error: syntax error, unexpected ';' in /var/www/vhosts/diabolotrucs.nl/httpdocs/bedankt.php on line 50
Dat is de eerste regel en de daarop volgende:
$email = (email_validator($_POST['email']) ? $_POST['email'] : false;
$name = $_POST['name'];
$comments = $_POST['comments'];
Maar nu geeft hij deze fout:
Parse error: syntax error, unexpected '{', expecting '(' in /var/www/vhosts/diabolotrucs.nl/httpdocs/bedankt.php on line 68