Skip to content
Snippets Groups Projects
Commit be4db823 authored by fajarnugroho's avatar fajarnugroho
Browse files

fix validate.php

parent 6abc7121
Branches
No related merge requests found
...@@ -55,9 +55,9 @@ function validateEmail($email) { ...@@ -55,9 +55,9 @@ function validateEmail($email) {
} }
return 0; return 0;
} }
$response = ''; if ($_SERVER['REQUEST_METHOD'] == 'POST'){
switch ($_GET['form']) { switch ($_GET['form']) {
case 'username': case 'username':
if (validateUsername($_GET['value'])){ if (validateUsername($_GET['value'])){
echo 'invalid'; echo 'invalid';
} else { } else {
...@@ -65,13 +65,14 @@ switch ($_GET['form']) { ...@@ -65,13 +65,14 @@ switch ($_GET['form']) {
} }
break; break;
case 'email': case 'email':
if (validateEmail($_GET['value'])){ if (validateEmail($_GET['value'])){
echo 'invalid'; echo 'invalid';
} else { } else {
echo 'valid'; echo 'valid';
} }
break; break;
}
} }
// echo $response; // echo $response;
?> ?>
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment