-
Notifications
You must be signed in to change notification settings - Fork 0
/
login_form.php
101 lines (78 loc) · 2.89 KB
/
login_form.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
73
74
75
76
77
78
79
<?php
#this is Login form page , if user is already logged in then we will not allow user to access this page by executing isset($_SESSION["uid"])
#if below statment return true then we will send user to their profile.php page
if (isset($_SESSION["uid"])) {
header("location:profile.php");
}
//in action.php page if user click on "ready to checkout" button that time we will pass data in a form from action.php page
if (isset($_POST["login_user_with_product"])) {
//this is product list array
$product_list = $_POST["product_id"];
//here we are converting array into json format because array cannot be store in cookie
$json_e = json_encode($product_list);
//here we are creating cookie and name of cookie is product_list
setcookie("product_list",$json_e,strtotime("+1 day"),"/","","",TRUE);
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Ecommerce</title>
<link rel="stylesheet" href="css/bootstrap.min.css"/>
<script src="js/jquery2.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="main.js"></script>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div class="wait overlay">
<div class="loader"></div>
</div>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<a href="#" class="navbar-brand">Ecommerce</a>
</div>
<ul class="nav navbar-nav">
<li><a href="index.php"><span class="glyphicon glyphicon-home"></span>Home</a></li>
<li><a href="index.php"><span class="glyphicon glyphicon-modal-window"></span>Product</a></li>
</ul>
</div>
</div>
<p><br/></p>
<p><br/></p>
<p><br/></p>
<div class="container-fluid">
<div class="row">
<div class="col-md-2"></div>
<div class="col-md-8" id="signup_msg">
<!--Alert from signup form-->
</div>
<div class="col-md-2"></div>
</div>
<div class="row">
<div class="col-md-4"></div>
<div class="col-md-4">
<div class="panel panel-primary">
<div class="panel-heading">Customer Login Form</div>
<div class="panel-body">
<!--User Login Form-->
<form onsubmit="return false" id="login">
<label for="email">Email</label>
<input type="email" class="form-control" name="email" id="email" required/>
<label for="email">Password</label>
<input type="password" class="form-control" name="password" id="password" required/>
<p><br/></p>
<a href="#" style="color:#333; list-style:none;">Forgotten Password</a><input type="submit" class="btn btn-success" style="float:right;" Value="Login">
<!--If user dont have an account then he/she will click on create account button-->
<div><a href="customer_registration.php?register=1">Create a new account?</a></div>
</form>
</div>
<div class="panel-footer"><div id="e_msg"></div></div>
</div>
</div>
<div class="col-md-4"></div>
</div>
</body>
</html>