重複の可能性:
書き込みコンテキストで関数の戻り値を使用できない
これが変数のソースです。
<?php
if ($admin->get_permissions()=3)
echo 'Welcome to the Admin Panel';
else
echo 'Sorry, You do not have access to this page';
?>
そして、if ステートメントで実際に呼び出そうとしているコードは次のとおりです。
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 '';
}
これは、else if ステートメントを使用して、ユーザーが承認されているページを呼び出す簡単な方法です。か、そう思った