survey_seahorse

Software Engineering Project - Fall 2018
Log | Files | Refs | README

commit 9c509c8e5156c2e4e32603d0d19e001cddf6cf9e
parent 95839ee705305081a34c9ad164f2616d02e610f9
Author: John Kubach <johnkubach@gmail.com>
Date:   Sun, 16 Dec 2018 15:54:28 -0500

navbar update

check if there is a user logged in

Diffstat:
Mwebsite/index.php | 7++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/website/index.php b/website/index.php @@ -9,7 +9,12 @@ $q = mysqli_fetch_assoc($result); $sql = "select * from user order by registration_date desc limit 1;"; $result = mysqli_query($connect, $sql) or die(mysqli_error($connect)); $newUser = mysqli_fetch_assoc($result); +if (isset($_SESSION['username'])) { $user = $_SESSION['username']; + $profile = $user . "'s Profile"; +} else { + $profile = "Profile"; +} ?> <head> <title>Survey Seahorse</title> @@ -26,7 +31,7 @@ $user = $_SESSION['username']; <link rel = "stylesheet" href= "res/nav.css" /> <div class= nav> <a href="index.php" target="_blank"> Home </a> - <a href="profile.php" target="_blank"> <?php echo $user; ?>'s Profile </a> + <a href="profile.php" target="_blank"> <?php echo $profile; ?> </a> <a href="directory.php" target="_blank"> Surveys </a> <a href="createsurvey.php" target="_blank"> Create a Survey </a> </div>