aboutsummaryrefslogtreecommitdiff
path: root/test/edit.inc.php
diff options
context:
space:
mode:
authorMateja <mail@matejamaric.com>2020-10-01 14:50:02 +0200
committerMateja <mail@matejamaric.com>2020-10-01 14:50:02 +0200
commit16939b4344b67ac8146015231af4d2fe691e90ce (patch)
tree50ba9f7093fd25d5d7aeee0ea5a240296fa68c98 /test/edit.inc.php
parent524fdc3a0ea3960823472e7e3f948b0cdd2003ef (diff)
downloadold-php-yota-16939b4344b67ac8146015231af4d2fe691e90ce.tar.gz
old-php-yota-16939b4344b67ac8146015231af4d2fe691e90ce.zip
tiding up...
Diffstat (limited to 'test/edit.inc.php')
-rw-r--r--test/edit.inc.php21
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;
+}