aboutsummaryrefslogtreecommitdiff
path: root/test/test.php
diff options
context:
space:
mode:
authorMateja <mail@matejamaric.com>2020-09-28 19:14:53 +0200
committerMateja <mail@matejamaric.com>2020-09-28 19:14:53 +0200
commit00fda2f0dfdaa1129949f0fa116cfaeff23ab486 (patch)
tree7ff6596f038c84771484da6c8150ce441aad89c6 /test/test.php
downloadold-php-yota-00fda2f0dfdaa1129949f0fa116cfaeff23ab486.tar.gz
old-php-yota-00fda2f0dfdaa1129949f0fa116cfaeff23ab486.zip
first commit
Diffstat (limited to 'test/test.php')
-rw-r--r--test/test.php34
1 files changed, 34 insertions, 0 deletions
diff --git a/test/test.php b/test/test.php
new file mode 100644
index 0000000..5bca6ac
--- /dev/null
+++ b/test/test.php
@@ -0,0 +1,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>