Jump to content

Recommended Posts

I'm new to PHP and I usually learn by doing examples, so here is one I'm working on

l.orgfree.com/index.php

In this simple version i can register, logout, login. but I want to know how I can make it so users can view their information, and change it, and add new registration fields in the register page(e-mail, a confirm password box, a I agree to terms checkbox (where if not checked it brings you back)).

Also I was wondering how I can give different users a status, like a admin, guest, user, or super user.

I'm new to php and I was hoping you guys could point me in the right direction. I'm using mysql for the database, MySQL client version: 5.0.27)

-Thank you for your time

~L

Link to comment
https://forums.phpfreaks.com/topic/54048-solved-login-help/
Share on other sites

Well, to do everything you want to do you will need a database. I assume you have a users table? Well, in that table just add a row called "rank" and put what rank they are. Then when you program you would obviously have to add who can do what depending on what their rank in the DB is.

 

To have a page where all their information is on, you would just store all their information in the database. When they update it you will just have to program a simple mysql query.

 

Example:

mysql_query("UPDATE `users` SET `password`='$password', `username`='$username' WHERE ID='$id'");

 

When they log in you can register them a unique session [their ID in the DB] so you can pull information from the database on them by using that session.

 

I know you may not understand everything I just put...but it's a start. I would just recommend getting the basics down before jumping into projects.

Link to comment
https://forums.phpfreaks.com/topic/54048-solved-login-help/#findComment-267209
Share on other sites

Yah, you're right....I guess I have to do some more work before attempting anything big. Thanx for the advice though...I think I can do the rank thing right now and I'll give it a try...

-Thanx for replying though

~L

 

EDIT: Yah, never mind that.....I'm pretty much lost, but I''ll just go back to the tut.

Link to comment
https://forums.phpfreaks.com/topic/54048-solved-login-help/#findComment-267210
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.