duanli6834 2012-06-03 19:45
浏览 64
已采纳

PHP检查用户是否查看了特定页面

I am currently building web app in PHP where the client wants to have logged in users. There will be hierarchy so the new users won't have priviliges as higher positioned users. The priviliged users will be able to post articles and files for users to see.

This is my question: How can adminisitrator or the privileged user check who viewed the article or downloaded the files. Is this possible via PHP?

  • 写回答

2条回答 默认 最新

  • douou1872 2012-06-03 19:49
    关注

    Of course it's possible, but you won't get it out of the box most likely. You'll need to store the access history for any given user server-side. You could do this by simply storing user ids, urls, and times in a seperate table in your database. Something along the lines of:

     5 | '/filedownload.php?file=cake-instructions.php' | 2012-02-15 08:23:11
     8 | '/company-information'                         | 2012-02-15 08:15:01
    

    Anytime a user accesses a url, you store their id, that url, and the current time in a database. This would then be readily accessible to administrators if they want to perform queries to see who viewed what, and when.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?
  • ¥15 matlab(相关搜索:紧聚焦)
  • ¥15 基于51单片机的厨房煤气泄露检测报警系统设计
  • ¥15 Arduino无法同时连接多个hx711模块,如何解决?
  • ¥50 需求一个up主付费课程
  • ¥20 模型在y分布之外的数据上预测能力不好如何解决