forked from chapagain/crud-php-complete
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
32 lines (30 loc) · 818 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
<?php session_start(); ?>
<html>
<head>
<title>Homepage</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="header">
Welcome to my page!
</div>
<?php
if(isset($_SESSION['valid'])) {
include("connection.php");
$result = mysqli_query($mysqli, "SELECT * FROM login");
?>
Welcome <?php echo $_SESSION['name'] ?> ! <a href='logout.php'>Logout</a><br/>
<br/>
<a href='view.php'>View and Add Products</a>
<br/><br/>
<?php
} else {
echo "You must be logged in to view this page.<br/><br/>";
echo "<a href='login.php'>Login</a> | <a href='register.php'>Register</a>";
}
?>
<div id="footer">
Created by <a href="http://blog.chapagain.com.np" title="Mukesh Chapagain">Mukesh Chapagain</a>
</div>
</body>
</html>