aboutsummaryrefslogtreecommitdiff
path: root/test/test.php
blob: 5bca6aceafed6e27387de1036c983b5fbfdcfea6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width initial-scale=1.0"/>
    <link href="../style.css" rel="stylesheet" type="text/css"/>
    <title>Test</title>
</head>
<body>
<main>
<?php
if($_SERVER["REQUEST_METHOD"] == "POST") {
	$email = clear_input($_POST['name']);
	if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
	  echo "You fucking bitch!<br>";
	} else {
	  echo "You oki: " . $email . "<br>";
	}
}
function clear_input($data) {
  $data = trim($data);
  $data = stripslashes($data);
  $data = htmlspecialchars($data);
  return $data;
}
include 'test.inc.php';
?>
<form method="POST">
<input type="text" name="name">
<input type="submit" name="your-submit" value="Submit">
</form>
</main>
</body>
</html>