-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathform.php
More file actions
97 lines (93 loc) · 1.66 KB
/
form.php
File metadata and controls
97 lines (93 loc) · 1.66 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<html>
</html>
<head>
<title>Registration Form</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<?php
session_start();
?>
<?php
$a="";
$b="";
$na=$nb="";
$c=0;
if(isset($_POST['submit']))
{
if (empty($_POST["uname1"]))
{
$a="Name is required";
}
else
{
$a="";
$na=$_POST["uname1"];
$c=$c+1;
}
if(empty($_POST["ps1"]))
{
$b="Password is required";
}
else
{
$nb=$_POST["ps1"];
$b="";
$c=$c+1;
}
if($c==2)
{
if($_POST["uname1"]==$_SESSION['uname'])
{
if($_POST["ps1"]==$_SESSION['ps'])
{
header("Location:main.php");
exit;
}
else
{
$b="enter valid username and password";
}
}
else
{
$b="enter valid username and password";
}
}
}
?>
<div id ="header">
<center><img src="shop.jpg" height="75" width="75"></img> letsshop</center>
</div>
<div id="content1">
<center><h2>LOGIN PAGE</h2></center>
<form method="post" action="form.php">
<table id="table2" cellspacing="15" align="center"><b>
<tr>
<td><b>Username:</b></td><td><input type="text" name="uname1" value="<?php echo $na ?>"/></br></td>
</tr>
<tr> <td colspan="2"><span class="error"><?php echo $a;?></span></td></tr>
<tr>
<td><b>Password:</b></td><td><input type="password" name="ps1" value="<?php echo $nb ?>"/></br></td>
</tr>
<tr> <td colspan="2"><span class="error"><?php echo $b;?></span></td></tr>
<tr> <td colspan="2"></td></tr>
<tr>
<td colspan="2"><center>
<input type="submit" value="SUBMIT" name="submit" />
</center></td></tr>
</table>
</form>
</div>
<div id="content2">
</div>
<div id="lefttop">
</div>
<div id="left">
</div>
<div id="content2">
</div>
<div id="left1">
</div>
</body>
</html>