forked from cs290summer/assignment5
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcontent1.php
More file actions
29 lines (26 loc) · 683 Bytes
/
Copy pathcontent1.php
File metadata and controls
29 lines (26 loc) · 683 Bytes
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
<?php
session_start();
if($_SERVER['REQUEST_METHOD'] === 'POST') {
if (isset($_POST["userName"])) {
$_SESSION["user"] = $_POST["userName"];
$_SESSION["count"] = 1;
}
}
if (!isset($_SESSION["user"])) {
header("Location: http://web.engr.oregonstate.edu/~smithcr/assignment5/login.php");
}
$count = $_SESSION["count"]++;
?>
<!DOCTYPE html>
<html>
<head>
<title><?=$count?></title>
</head>
<body>
content 1
count: <?=$count?>
<p> user: <?=$_SESSION["user"]?></p>
<a href="http://web.engr.oregonstate.edu/~smithcr/assignment5/content2.php">other</a>
<a href="http://web.engr.oregonstate.edu/~smithcr/assignment5/logout.php">logout</a>
</body>
</html>