-
Notifications
You must be signed in to change notification settings - Fork 2
/
login.php
72 lines (50 loc) · 1.69 KB
/
login.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
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
67
68
69
70
71
72
<!DOCTYPE html>
<html>
<head>
<title>Login</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
<style type="text/css">
body{
background: radial-gradient(#fff,#ffd6d6);
}
</style>
</head>
<body>
<?php
echo "<img id = 'logo' src ='item/newauction.png'/>";
echo "<br>";
echo "<form name='regform' form class = 'login_form' action = 'check_login.php' onsubmit='return validationn()' method = 'POST'>";
echo "<h4>Login</h4>";
echo "<script>
function validationn() {
//initialize all the variables here
//get the username from the form ...we will use the name regform since we specified it in the form name='regform'
var username = document.forms['regform']['username'];
var password = document.forms['regform']['password'];
//add more variables here eg email gender etc
//validate that the username is not empty
if (username.value == '') {
window.alert('Please enter your username');
//move the cursor to username
username.focus();
return false;
}
//validate password not empty
if(password.value == ''){
window.alert('please enter your Password.');
window.focus();
return false;
}
}
</script>";
echo "<label class = 'label' for = 'username' >Username :</label>";
echo "<input class = 'text' type ='text' name = 'username' placeholder = 'Username' >";
echo "<br>";
echo "<label class = 'label' for = 'password'>Password :</label>";
echo "<input class = 'password' type = 'password' name = 'password' placeholder = 'Password' >";
echo "<br>";
echo "<input class = 'submit' type = 'submit' value = 'Sign in'>";
echo "</form>";
?>
</body>
</html>