Using the information I received in previous answers, here is how I fixed my problem:
<?PHP // Retreive POST data and sanitize it: trim string, no HTML, plain text $variable1=htmlentities(trim($_POST['input1']), ENT_NOQUOTES); $variable2=htmlentities(trim($_POST['input2']), ENT_NOQUOTES); $emailaddress=$_POST['email']; // sanitizing email address happens below if(eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[az]{2,3})$", $emailadres)){ // check email address and if legit, do this: echo '<p>The e-mail address given is valid.</p>' } else{ // if email is not legit, do this: echo '<p>The e-mail address given is not valid.</p>'; } ?>
Hope this helps someone :)
source share