-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathheader.php
More file actions
71 lines (70 loc) · 2.58 KB
/
header.php
File metadata and controls
71 lines (70 loc) · 2.58 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
<?php
session_start(); /* Starts the session */
try {
$db = new PDO("mysql:host=localhost;dbname=OLFM","root","");
$db->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);
$db->exec("SET NAMES 'utf8'");
// var_dump($db);
} catch (Exception $e) {
echo "Could not connect to the database.";
exit;
}
//echo "Woo-hoo!";
if(isset($_POST['submitl'])){
$usernamel = isset($_POST['usernamel']) ? $_POST['usernamel'] : '';
$passwordl = isset($_POST['passwordl']) ? $_POST['passwordl'] : '';
$se="SELECT * FROM users WHERE uname='$usernamel' and upwd='$passwordl'";
$sr=$db->query($se);
$nr=$sr->fetchColumn();
if($nr!=false){
$_SESSION['username']=$usernamel;
}
else{
$_SESSION['logincheck']='invalid';
}
}
?>
<link rel="stylesheet" type="text/css" href="css/main.css">
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap-theme.min.css">
</head>
<body>
<!--main body starts-->
<div id="main">
<!--top navbar starts-->
<div id="top">
<lable id="wlcm"></lable>
<a tabindex="1" id="signed" data-toggle="modal" href="#iModal">Login/Sign up</a>
<a tabindex="2" id="glyphcart" class="glyphicon glyphicon-shopping-cart" data-toggle="modal" href="#iModal">(<span id="s1">0</span>)</a>
</div>
<!--top navbar ends-->
<!--carousel starts-->
<div id="headimage" class="carousel slide carousel-inner">
<div class="item active">
<img src="images/Picture2.png" alt="olfm">
</div>
<div class="item">
<img src="images/broccoli.jpg" alt="broccoli">
</div>
<div class="item">
<img src="images/ginger.jpg" alt="ginger">
</div>
<div class="item">
<img src="images/tomato.jpg" alt="tomato">
</div>
<div class="item">
<img src="images/potato.jpg" alt="potato">
</div>
<div class="item">
<img src="images/apple.jpg" alt="apple">
</div>
<a class="left carousel-control" href="#headimage" data-slide="prev">
<span class="icon-prev"></span>
</a>
<a class="right carousel-control" href="#headimage" data-slide="next">
<span class="icon-next"></span>
</a>
</div>
<!--carousel ends-->