Php login permission verification question this post was last edited by yangyi1234567 from 2013-02-0220:53:42 & lt ;? Phpinclude (config. php); $ sqlselect & nbsp; * & nbsp; from & nbsp; admin & nbsp; where & nbsp; name & nbsp; $ _ SES php login permission verification
This post was last edited by yangyi1234567 at 20:53:42
Include ('config. php ');
$ SQL = "select * from admin where name = '$ _ SESSION [ui]'";
$ Query = mysql_query ("$ SQL ");
$ Row = mysql_fetch_array ($ query );
$ Uus = is_array ($ row );
$ Pps = $ uus? $ _ SESSION ['shell'] ==$ row ['password']: FALSE;
If ($ pps ){
Echo $ _ SESSION ['ui'];
} Else {
Echo "no access permission ";
Exit ();
}
?>
When there is no session, the following error messages will appear when you open the modification page. what is the cause of this error?
Notice: Undefined index: ui in C: \ xampp \ htdocs \ sousuo \ check. php on line 14
No access permission
------ Solution --------------------
No definition, but output is required.
If (isset ($ _ SESSION ['ui'])
Echo $ _ SESSION ['ui'];