-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexample.php
More file actions
66 lines (48 loc) · 1.39 KB
/
example.php
File metadata and controls
66 lines (48 loc) · 1.39 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<?php
include_once 'Validator.php';
// check if the number is between 10,30
if (!Validator::Number(5, 50, 20)) {
echo "The number is not between 20 and 50";
} else {
echo "Yes, the number is between 20 and 50";
}
echo "<br/>";
// email validation
if (!Validator::Email("shibly.phy@gmail.com")) {
echo "Invalid email address";
} else {
echo "Email is valid ";
}
echo "<br/>";
// Email address validation with exception
if (!Validator::Email("Shibly.phy@test.com", array("test.com"))) {
echo "test.com is not allowed";
}
echo "<br/>";
if (!Validator::Alpha('asd123')) {
echo "this is not a alpha numeric string";
} else {
echo "This is a alpha numeric string";
}
echo "<br/>";
if (!Validator::Number("123")) {
echo "Not a number";
} else {
echo "Is a number";
}
echo "<br/>";
if (!Validator::Ip("192.164.1.3")) {
echo "This is not a valid IP address";
} else {
echo "This is a valid Ip Address";
}
?>
</body>
</html>