diff options
Diffstat (limited to 'test/edit.inc.php')
-rw-r--r-- | test/edit.inc.php | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/test/edit.inc.php b/test/edit.inc.php index cb0c23f..3309a7b 100644 --- a/test/edit.inc.php +++ b/test/edit.inc.php @@ -1,7 +1,18 @@ <?php -/* -if (isset($_POST['subvar'])) { - echo $_POST['subvar']; -} -*/ echo $_POST['action']; + +if($_SERVER["REQUEST_METHOD"] == "POST" && isset(_POST['email'])) { + $email = clear_input($_POST['email']); + if (!filter_var($email, FILTER_VALIDATE_EMAIL)) { + echo "Email is not valid: " . $email . "<br>"; + } else { + echo "Email is valid: " . $email . "<br>"; + } +} + +function clear_input($data) { + $data = trim($data); + $data = stripslashes($data); + $data = htmlspecialchars($data); + return $data; +} |