简体   繁体   中英

Loop through mysql array and for each variabe create a session

I have two types of users, Manager and employees. Currently I have a session working when the manager is logged on. To allow the manager to view each individual employees i need to create another session for each employee, to remeber which employee he has clicked on.

How would I do this, how would I remember the ID of the employeer?

To parse a single ID from page to page - there is no need to use Sessions.

Just parse it through the URL. For Example:

<a href='page2.php?id=248>link to page2</a> 

then to retrieve this you will need on the other page :

$id=$_REQUEST['id'];

That worked for me!

But be careful you don't want to be parsing passwords and other secure information through the URL

尝试创建会话变量这样

$_SESSION['counter'. $studentID] 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM