Can't use method return value in write context; Not sure where to go from here
Posted
by
Morgan Green
on Stack Overflow
See other posts from Stack Overflow
or by Morgan Green
Published on 2012-10-07T03:34:43Z
Indexed on
2012/10/07
3:36 UTC
Read the original article
Hit count: 150
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
© Stack Overflow or respective owner