Jump to content

Limit access to Form


tomm098

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.