关于权限,仅自己可见的问题

WBOY
Release: 2016-06-23 14:03:17
Original
1073 people have browsed it

我要实现登录以后,如一篇文章仅这个登录人可见,应该如何实现,用php来做,应该怎样做了?


回复讨论(解决方案)

你怎么验证用户已登录的呢?
每篇文章的数据库里,应该有一个字段为uid。
if($uid==$current_user_id){
// 显示文章
}
前一个uid为文章数据库里作者的uid, 后一个为用户登录数据库里的id。

是否对自己可见要设置一个字段,这个字段存在数据库里面。然后用楼上的判断即可

在你查询的之前,判断是否用户登录。

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!