Forums

Server Side Validation not working

wmuckell 04 Nov, 2009
<?php

function is_email_valid($email){
    return (preg_match("/[-a-zA-Z0-9_.+]+@[a-zA-Z0-9-]{2,}\.[a-zA-Z]{2,}/", $email) > 0) ? true : false;
}


if($_POST['First_Name']==""){
    return "Please supply us with your name";
}
if($_POST['Telephone']==""){
    return "Please enter your telephone number.";
}
if(!is_email_valid($_POST['Email'])){
    return "You have not entered a correct email!";
}
if($_POST['Comments']{
    return "You have not left us any message!";
}



?>


This is my code and if I turn off Javascript to test it does not do anything. Can anyone help?
GreyHead 04 Nov, 2009
Hi wmuckell,

The code looks OK. Do you have server-side validation turned on??

Bob
This topic is locked and no more replies can be posted.