forked from neoben/eCommerce
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
47 lines (33 loc) · 836 Bytes
/
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
<?php
require_once("modules/config.php");
require_once("modules/class_session.php");
$session_class = new Sessions();
session_start();
if(isset($_SESSION['username'])) {
header('Location: modules/store.php');
}
$link = mysql_connect(HOST, USER, PW);
if (!$link) {
die ("Error connecting to the database: " . mysql_error());
}
$db_selected = mysql_select_db(DB, $link);
if (!$db_selected) {
die ("Error selecting the database: " . mysql_error());
}
/* Database query for the products */
$query = "SELECT * FROM products";
$products = mysql_query($query);
if (!$products) {
die("Query error $query: " . mysql_error());
}
include("modules/header.html");
?>
<div id="center">
<?php
include("modules/storewindow.php");
include("modules/login.html");
?>
</div>
<?php
include("modules/footer.html");
?>