Information and Links
Join the fray by commenting, tracking what others have to say, or linking to it from your blog.
aMember check for a logged in user using php
Recently I needed to verify if a user was logged in on a site using aMemberPro. But the site uses the new_write method, and I needed a way to check for this quickly in a php file for an include block. Here is what I added to the php page:
CODE:
-
session_start();;
-
$amember_id = (isset($_SESSION['_amember_id']) && !empty($_SESSION['_amember_id'])) ? $_SESSION['_amember_id'] : false;
-
if (!$amember_id) {
-
include('path/to/my/block.inc.php');
-
}
Not sure how right or wrong this is, but it works rather well.


aMember has a built in php include method available. In the protect folder, after choosing the folder, choose php_include. The code you need to use will be presented.
David
Membership Academy
http://www.membershipacademy.com