tomm098 Posted August 26, 2009 Share Posted August 26, 2009 Hey all. I need to limit access to one of my forms. I need the form to only show if the user is logged in. The 'User' field of the form has a default value which is: <?php echo $_SESSION['MM_Username']; ?> Thanks a lot. Link to comment https://forums.phpfreaks.com/topic/171915-limit-access-to-form/ Share on other sites More sharing options...
oni-kun Posted August 26, 2009 Share Posted August 26, 2009 Something like this? <?php if (!$_SESSION['MM_Username']) { echo 'You need to log in first!'; //If no session, not logged in } else { echo "<form> yeah! </form>"; //If logged in } ?> That'll check to see if the session contains a username, and if the user is logged in, elsewise display nothing or you can header() to a login page. Link to comment https://forums.phpfreaks.com/topic/171915-limit-access-to-form/#findComment-906489 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.