-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path32.formValidation.php
37 lines (29 loc) · 950 Bytes
/
32.formValidation.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
35
36
37
<?php
if(isset($_POST['click'])) {
$userName = $_POST['username'];
$password = $_POST['password'];
if(strlen($userName)<5){
echo "<h3 style='color:red'>UserName has to be longer than 5</h3>";
}
else
echo 'Your Username is '.$userName.' and your Password is '.$password ;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<form action = "32.formValidation.php" method="post">
<pre>
<input type="text" placeholder = "Enter username" name="username" />
<input type="password" placeholder = "Enter Passwrod" name="password" />
<input type="submit" value="click" name="click"/>
</pre>
</form>
</body>
</html>