1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Creating a User Managament System

Discussion in 'PHP' started by sylar48, Jan 22, 2011.

  1. #1
    Hi there,

    I am trying to build a website with membership. But I do not know much about how to achieve it. Can someone please suggest me any good resources or tutorials for it?

    Also, how can make it like this: facebook.com/myprofilepage

    I mean when someone registered to the site, I want to give him a page like: mysite.com/newuser something like this. Any idea?

    Thank in advance!

    Of course, in PHP:)
     
    sylar48, Jan 22, 2011 IP
  2. vineld

    vineld Greenhorn

    Messages:
    53
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    18
    #2
    Since your programming skills seem rather limited you have three options:

    1. Learn programming
    2. Hire a programmer
    3. Install some community software such as SocialEngine or Wordpress + Buddypress
     
    vineld, Jan 22, 2011 IP
  3. CPAPubMichael

    CPAPubMichael Peon

    Messages:
    231
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Membership systems are fairly easy to create, i would recommend you check out some video tutorials on PHP member base scripts.

    As for the profile thing, you can do that but you have to think, what if a use creates the same user name as a folder? Like has the user name called "Includes". You can easily do that with htaccess and PHP.

    Or, the other suggestion i have is that you have a page called "profile.php" then code the script so it would be positioned like his "profile.php?id=IDHERE". That is the easiest option for you.

    Thanks,

    Michael
     
    CPAPubMichael, Jan 22, 2011 IP
  4. sylar48

    sylar48 Peon

    Messages:
    162
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Yes, I am still learning and I am thinking this project as a way to learn new things in PHP and improve my PHP skills. But thanks for your suggestions.
     
    sylar48, Jan 22, 2011 IP
  5. sylar48

    sylar48 Peon

    Messages:
    162
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thank you Michael for your suggestion. I am going to try your suggestions.
     
    sylar48, Jan 22, 2011 IP
  6. webber09

    webber09 Active Member

    Messages:
    131
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    71
    #6
    hi guys, i am looking to do this exact thing to make a staff/admin area and they have curtain privileges depending on who is logged in.

    how do you make a single page, such as profile.php see who is logged in, like you have put above? profile.php?id=IDHERE
     
    webber09, Jan 22, 2011 IP
  7. G3n3s!s

    G3n3s!s Active Member

    Messages:
    325
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    80
    #7
    I think you didn't get what profile.php?id=IDHERE should do.
    It should show profile of user with id IDHERE (1239125 for example)
    What are you asking for?
     
    G3n3s!s, Jan 22, 2011 IP
  8. webber09

    webber09 Active Member

    Messages:
    131
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    71
    #8
    basically i need it to go to a 'profile' area when the user logs in. so if a staff member logs in it will only give them access to 'staff things' and admin only 'admin things', however just to make it a lil more complicated, i need individual logins too.

    so all in all it needs to have: different login details (usernames) for each user, and for each type of user to have access to only the info they should
     
    webber09, Jan 22, 2011 IP
  9. G3n3s!s

    G3n3s!s Active Member

    Messages:
    325
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    80
    #9
    you have to put access column in your users table and then check it

    something like

    $check = mysqli_query($connect, "SELECT access FROM users WHERE id = ".$_POST['uid']);
    if ($user_Access = mysqli_fetch($connect, $check))
    {
     switch ($user_Access)
     {
      case "admin":
       header("Location:admin.php");
      break;
      case "normall_user":
       header("location:profile.php");
      break;
     }
    }
    
    PHP:
    so in this case, if that row in users table has access column value "admin", so it will redirect admin after logging to admin.php, if it is regular user, it redirects him to profile.
    Sorry If I made mistake within mysqli query, because I use only mysql
     
    G3n3s!s, Jan 22, 2011 IP
  10. webber09

    webber09 Active Member

    Messages:
    131
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    71
    #10
    right i understand... thanks a lot!!
     
    webber09, Jan 22, 2011 IP
  11. G3n3s!s

    G3n3s!s Active Member

    Messages:
    325
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    80
    #11
    if you want to have profile like this

    mypage.com/G3n3s!s

    i would not suggest it. Better would be

    mypage.com/profile/G3n3s!s

    and you could do that by adding .htaccess file with this content

    RewriteEngine on
    RewriteRule profile/([0-9a-zA-Z-\/\,\.)+ profile.php?username=$1
    
    Code (markup):
    and in profile.php you have to check $_GET['username']

    BTW there is add_reputation button below my posts, please add it ;)
     
    G3n3s!s, Jan 22, 2011 IP
    webber09, sylar48 and interwho like this.
  12. webber09

    webber09 Active Member

    Messages:
    131
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    71
    #12
    done and again, thank you
     
    webber09, Jan 22, 2011 IP
  13. G3n3s!s

    G3n3s!s Active Member

    Messages:
    325
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    80
    #13
    however, be aware if you want to use it on public, hacckers could hack it easily with this method
    you have to learn something about security in php & MYsql queries, SQL injections & XSS attacks ;)
     
    G3n3s!s, Jan 22, 2011 IP
  14. webber09

    webber09 Active Member

    Messages:
    131
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    71
    #14
    it will be installed on a hosted server and will be put behind passwords galore!! no one will be able to access it without knowing the url anyway
     
    webber09, Jan 22, 2011 IP
  15. G3n3s!s

    G3n3s!s Active Member

    Messages:
    325
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    80
    #15
    no one needs url
    he can use something like

    myssite.com/profile/s' or 1 = 1

    and it selects all users. It won't happen in this case but be aware, you really should read some articles about security. It will be Social Network ?
     
    G3n3s!s, Jan 22, 2011 IP
  16. webber09

    webber09 Active Member

    Messages:
    131
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    71
    #16
    no, it will only be accessable by staff. hence why the url will only be given to the staff
     
    webber09, Jan 22, 2011 IP
  17. G3n3s!s

    G3n3s!s Active Member

    Messages:
    325
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    80
    #17
    okay but in that case change admin.php to something like a65sd46as45fse6f45sd65f4s.php so no one can trace it
     
    G3n3s!s, Jan 22, 2011 IP
  18. webber09

    webber09 Active Member

    Messages:
    131
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    71
    #18
    wise idea... will do
     
    webber09, Jan 22, 2011 IP
  19. developer619

    developer619 Peon

    Messages:
    93
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #19
    its not a way to learn anything on forum at beginner level because here everyone just give you an idea rather teach you....
     
    developer619, Jan 23, 2011 IP
  20. G3n3s!s

    G3n3s!s Active Member

    Messages:
    325
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    80
    #20
    yep but he can learn something from our ideas.
     
    G3n3s!s, Jan 24, 2011 IP