-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
67 lines (67 loc) · 2.42 KB
/
index.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
<html>
<head>
<meta charset="utf-8">
<title></title>
<style>
.bg {
background-image: url("images/online-shopping-pic.jpg");
height: 100%;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
.footer {
position:fixed;
bottom: 0;
width: 100%;
color: #000033;
text-decoration:none;
font-size:25px;
font-weight:900;
}
</style>
</head>
<body>
<div class="bg">
<div style="float:left;padding-left:50px;padding-top:40px"><form method="post" style="opacity:.9;border: 2px solid black;margin: auto;text-align: center;width:340px;height:200px">
<h2 style="padding-left:5px">SIGN IN</h2><hr>
<input type='text' name='n1' placeholder="EMAIL OR MOBILE" ><br><br>
<input type='password' name='n2' placeholder="PASSWORD" ><br><br>
<input style="background-color:#000099;color:#ffffff;width:70px;height:30px" type="submit" value="Sign In" name='btn'>       
</form>
</div><br>
<div style="padding-right:905px;padding-top:250px"><form action='sign up.php' method="post" style="opacity:.9;border: 2px solid black;margin: auto;text-align: center;width:340px;height:200px">
<h2 style="padding-left:5px">SIGN UP</h2><hr>
<p style="font-weight:900;color:#003300 ;font-size:22px">New Customer ?</p>
<div><a href='sign up.php'><button style="background-color:#000099;color:#ffffff;width:70px;height:30px" type="submit" value="Sign Up" name='btn1'>Sign Up</button></a></div>
</form>
</div>
<div><a class="footer" style="left:310px" href='#'>|    HOME     |   </a></div>
<div><a class="footer" style="left:480px" href='about us.php'>ABOUT US     |   </a></div>
<div><a class="footer" style="left:660px" href='contact us.php'>CONTACT US     |   </a></div>
<div><a class="footer" style="left:880px" href='product.php'>PRODUCTS     |   </a></div>
</div>
</body>
</html>
<?php
session_start();
if(isset($_POST['btn']))
{
$id=$_POST['n1'];
$pass=$_POST['n2'];
$con=new MySQLi("localhost","root","","project");
$sql="select * from registration where email='$id' and password='$pass' or mobile='$id' and password='$pass' ";
$res=$con->query($sql);
$c=$res->num_rows;
if($c>=1)
{
$row=$res->fetch_array();
$_SESSION['id']=$row[0];
echo "<script>window.location.href='product.php'</script>";
}
else
{
echo "Invalid user";
}
}
?>