<?php
if (!isset($_POST['ign'], $_POST['email'])) {
if($_POST['ign'] && $_POST['email']){
echo "Please fill out all of the fields!";
die;
}
if (empty($_POST['ign']) || empty($_POST['email'])) {
echo ("Please enter all of the values!");
die;
}
if(filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) {
$email = $_POST['email'];
echo ("Thanks, " . htmlentities($_POST['ign']) . ", you will recieve an email when the site is complete!");
}
else {
echo "Your email was invalid!";
die;
}
?>
I'm getting a syntax error on the last line where ?> is..
Also, just a random side note, can anyone teach me how to insert this into my code?
$valid = (bool)preg_match('/^[a-zA-Z0-9]{1,30}$/', $_POST['username']);
is it just
if ($valid == TRUE) {
////////
}
or is declaring that variable already running it?