blob: 3309a7b457e96532e5db9a8bfcad463e67e2ac37 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
<?php
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;
}
|