开发者

How to show user specific features when they are logged in?

I am trying to write code for a site for my consulting practice. I know how to have a database and how to manage users on the site. But now I want to charge users for custom features they want me to build from ground up. (e.g they want an option to upload pictures or ability to get certain reports via 3rd party API, which for purposes of this example is unique) So, my question is when they log in with their ID, how开发者_如何学C do i write a php code that shows only that particular option/features/page for that particular user?


How do you track the logged in user, in a session? You could do something simple like:

<?php
if ($_SESSION['userid'] == 4) {
     include('special_feature.php');
} ?>

To embed a certain block of code only for a certain user (or pull that user list from the database)...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜