Jump to content

Making Login help.


HaZaRd420

Recommended Posts

Hello all, This may be confusing and if you dont want to help that is fine with me. What I am trying to get at is to be able to login to a set ID that already has the name and set a password to it so the person will be able to edit there ID ( whats all in that certain id ). If I explained this to where you can not understand it, I will try to rephrase it for you, But hopefuly you will get what I am saying. I dont care about setting cookies or anything, I was just wondering if there is a quick way of doing this which Im sure there is. Thanks.
Link to comment
Share on other sites

Okay -- so correct me if I am wrong..
-- You have a table in your database that holds peoples usernames and passwords...

You want these people to be able to use a form to log in and say edit some values that would say make up something like a profile?
Link to comment
Share on other sites

Well, to do it in the most basic way possible:

You could set up your users table with
username
email
userid
url
bio
password

And whatever else
Create a session variable that holds something like their id.  When they click the link to manage their profile, have the id passed in (profile.php?id=$_SESSION['id']) and then perform a check to see that the user is logged in and that the id attached to their login matches the one tied to their account, pull the info up from the DB into a table and then let them edit it. 
Link to comment
Share on other sites

First off -- on this site (im not sure where it is) there is a tutorial for making a login script...  You want to follow that tutorial to make the login script...

Then when logged in it will take you to a form that contains text boxes or whatever is needed for the information in the database..  throw in a query to select * from users where username = $username

$username will be declared from the login script (probably in a session or  a cookie actually)

Then echo out the information into the text boxes that way their current information is listed.. from there in the form you have the submit button and on that you just use the mysql UPDATE command to do the updating..  really not that hard..
Link to comment
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.