Php session code. Php session code can only be used by SID to determine whether to use cookies or sessions; jump to the page cannot be headerif (isset ($ _ POST [sub]) {includeconn. inc. php; $ sqlselectidfromusers php session code
The code only uses SID to determine whether the cookie or session is used.
; // The Jump page cannot be the header if (isset ($ _ POST [sub]) {include conn. inc. php; $ SQL = select id from users where name = '{$ _ POST [name]}' and password = '. md5 ($ _ POST [password]). '; $ result = $ mysqli-> query ($ SQL); // save the data if ($ result-> num_rows> 0) {$ row = $ result-> fetch_assoc (); $ _ SESSION [username] =$ _ POST [name]; $ _ SESSION [uid] =$ _ POST [uid]; $ _ SESSION [isLogin5] = 1; // jump to the echo 'script '; | r | echo location = 'index. php ?. SID. '; // SID constant: Use cookie if cookie is enabled. If cookie is not enabled, use session | r | echo 'script';} The echo username and password are incorrect.}?>
Conn. inc. php
comm.php
Index. php
. $ _ SESSION [username]. Hello! This is the homepage of the website; echo session_id ().; echo your permissions are as follows:; $ SQL = select allow_1, allow_2, allow_3, allow_4 from users where id = '{$ _ SESSION [uid]}'; $ result = $ mysqli-> query ($ SQL); $ user = $ result-> fetch_assoc (); if ($ user [allow_1]) {echo 111111111111 ;} if ($ user [allow_2]) {echo 222222222222;} if ($ user [allow_3]) {echo 333333333333;} if ($ user [allow_4]) {echo 444444444444 ;}?> > Page 2> Page 3> exit
The compiling of test. php and test2.php is exactly the same as that of index. php.
The response code only uses SID to determine whether the cookie or session is used. // The Jump page cannot be the header if (isset ($ _ POST [sub]) {include conn. inc. php; $ SQL = select id from users...