-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
executable file
·48 lines (40 loc) · 928 Bytes
/
index.php
File metadata and controls
executable file
·48 lines (40 loc) · 928 Bytes
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
<!DOCTYPE html>
<html>
<head>
<title>Validation</title>
</head>
<body>
<?php
if(@$_POST['submit']){
require_once 'Validx.php';
$rules=[
'name'=>'required||min:5',
'email'=>'required||email',
'password'=>'required||min:5',
'repassword'=>'same:password'
];
$msg=[
'email'=>[
'email'=>'This is not an email'
]
];
$valid=\Nahidz\Validx::validate($_POST, $rules, $msg);
if($valid->hasErrors()){
foreach ($valid->allErrors() as $err) {
echo '<li>'.$err.'</li>'; }
}
}
?>
<form action="" method="post">
<label>name</label><br/>
<input type="text" name="name"/><br/>
<label>email</label><br/>
<input type="text" name="email"/><br/>
<label>password</label><br/>
<input type="password" name="password"/><br/>
<label>re password</label><br/>
<input type="password" name="repassword"/><br/><br/>
<input type="submit" name="submit" value="submit">
</form>
</body>
</html>