开发者

Social Network PHP/MySQL Structure [closed]

开发者 https://www.devze.com 2023-02-05 04:09 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form. For help clari
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 12 years ago.

I want to create a social media site. I'm just planning it out at the moment, i'm thinking first to log the user in by username/password combo, checking against a mysql db and seeing if they exist. Thats simple enough. But i'm asking is, like Facebook, for a "Bio" page, would you put stuff like "select from friends where user_id = $user_id", that sort of thing? So do i use the same user_id over the开发者_如何学编程 whole page for selecting comments, contact info, friends, pictures, likes, dislikes? Is this right or is this poor application structure?


I think you ahve a long way to go.

Please dont take this the wrong way but you seem to lack the required skills to manually build such a platform.

If you had it in you to build a social network site you would understand authentications systems down to a tee, but you seem to lack that.

What i would suggest is that you use a custom open source framework specifically built for social interactions such as facebook.

Here a few to get you started

  • Elgg - Open Source Social Networking Engine
  • SocialEngine (Paid)
  • Anahita Engine (NEW!!)


When you log them in, get their userID from the database (I'm assuming you have an integral user id as well as their username/password in the user table) and store it in the session. You can then use that on all the pages in your site to do queries. If you were to base it on the query string or post data, people can easily change that.

This is a pretty standard way of doing things (in my experience).

You could also store a whole user object in a session variable, but then you'd have to worry about keeping it up-to-date.

0

精彩评论

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