我有一些空闲时间,我想建立一个社交网站作为学习体验。 我已经知道HTML,CSS,Javascript和基本的Mysql和Php。 我已经在CakePHP中构建了一个基本的登录认证系统。 我不明白(并且似乎无法在google或stackoverflow上找到)是如何构建一个登录系统,将用户带到一个只有他们可以访问的唯一页面。 提前致谢。</ p>
</ div>



I have some free time and I want to build a social network site as a learning experience. I already know HTML, CSS, Javascript and basic Mysql and Php. I've already built a basic login authentication system in CakePHP. What I don't understand (and can't seem to find on google or stackoverflow) is how to build a login system that takes the user to a unique page that only they can access. Thanks in advance.

dqaxw44567 我希望你能见到会话和cookie。
8 年多之前 回复
dongshike7171 使用PHP,它会像if(check_if_user_is_logged()){//显示我的秘密东西}这是一个非常广泛的问题
8 年多之前 回复
dongpa3109 你也不会在这里找到它
8 年多之前 回复


这将是一次很棒的学习经历,但是... </ p>

我想很多人会同意 您的问题非常广泛,这就是为什么您在StackOverflow上遇到问题时遇到的问题。 通过尝试阅读更多基础知识一次采取一小步,并在此处发布有关具体问题的信息将使您的驾驶更加顺畅,您不想头脑发热并冒着疯狂的风险。
当然说...让我帮你 开始:))</ p>

你说:</ p>

只有他们可以访问</ p>
</ blockquote>

我认为您应该尝试将其考虑在内,因为所有用户都在访问同一页面,但是从您的数据库中提取了唯一的数据。 现在,什么会告诉你的程序哪些唯一数据</ em>将被称为会话</ strong>。 因此,假设您登录Facebook,然后启动会话并告诉Facebook谁登录以及从数据库中提取哪些数据,从而可以访问哪些消息,您的姓名等等。</ p>

< p>以下是有关会话 Cookies 。 祝你好运:)</ p>
</ div>



This will be a great learning experience but...

I think many will agree that your question is very broad and that is why you're having a problem finding it on StackOverflow which is for specific questions. By taking one small step at a time by trying read more basics and post here about specific questions will make your ride much smoother, you don't want to dive headfirst and risk going crazy. With that said... Let me get you started :)

You say:

how to build a login system that takes the user to a unique page that only they can access

I think you should try to think of it as all users are accessing the same page, but with unique data is being pulled from your database. Now, what's going to tell your program which unique data to pull is going to be a something called a session. So lets say you login to Facebook, a session is then started and tells facebook who is logged in and which data to pull from the database, thus which messages you can access, your name, etc.

Here are simple tutorials on Sessions and Cookies. Good Luck :)

Csdn user default icon