-
Notifications
You must be signed in to change notification settings - Fork 4
/
ajaxSubmit.php
executable file
·34 lines (21 loc) · 799 Bytes
/
ajaxSubmit.php
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
<?php
/* RECEIVE POST */
$email=$_POST['email'];
$age=$_POST['age'];
/* VALIDATE HOW YOU NEED TO VALIDATE */
/* RETURN ERROR */
$arrayError[0][0] = "#email"; // FIELDID
$arrayError[0][1] = "Your email do not match.. whatever it need to match"; // TEXT ERROR
$arrayError[0][2] = "error"; // BOX COLOR
$arrayError[1][0] = "#age"; // FIELD
$arrayError[1][1] = "Your email do not match.. whatever it need to match"; // TEXT ERROR
$arrayError[1][2] = "error"; // BOX COLOR
$isValidate = true; // RETURN TRUE FROM VALIDATING, NO ERROR DETECTED
/* RETTURN ARRAY FROM YOUR VALIDATION */
/* THIS NEED TO BE IN YOUR FILE NO MATTERS WHAT */
if($isValidate == true){
echo "true";
}else{
echo '{"jsonValidateReturn":'.json_encode($arrayError).'}'; // RETURN ARRAY WITH ERROR
}
?>