Can't use method return value in write context; Not sure where to go from here
- by Morgan Green
This is my source for the variable.
<?php
if ($admin->get_permissions()=3)
echo 'Welcome to the Admin Panel';
else
echo 'Sorry, You do not have access to this page';
?>
And the code that I'm actually trying to call with the if statement is:
public function get_permissions() {
$username = $_SESSION['admin_login'];
global $db;
$info = $db->get_row("SELECT `permissions` FROM `user` WHERE `username` = '" . $db->escape($username) . "'");
if(is_object($info))
return $info->permissions;
else
return '';
}
This should be a simple way to call my pages that the user is authorized for by using an else if statement. Or So I thought