Lodius2000 Posted May 28, 2008 Share Posted May 28, 2008 so I have my login page that once a valid username is compared to the users in the database it writes that user to $_SESSION['username'], how do i go from simply writing a username into a session, to making that session into something that is required to display pages below the login page, say for altering or creating a blog post. would it just be something like <?php session_start(); if ($_SESSION['username']){ display_page(); } else { print '<a href="login.php">Login first dummy</a> or something more complicated? Thanks in advance Link to comment https://forums.phpfreaks.com/topic/107713-_session-and-security/ Share on other sites More sharing options...
dezkit Posted May 28, 2008 Share Posted May 28, 2008 <?php session_start(); if ($_SESSION['username']){ display_page(); } else { echo "<a href='login.php'>Login first dummy</a>"; ?> hilol Link to comment https://forums.phpfreaks.com/topic/107713-_session-and-security/#findComment-552177 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.