Jump to content

Archived

This topic is now archived and is closed to further replies.

HaZaRd420

Making Login help.

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.

Share this post


Link to post
Share on other sites
Yeah it makes no sense...  you want to log into an id and set a password to is so they can edit their id..  makes no sense...

Share this post


Link to post
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?

Share this post


Link to post
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. 

Share this post


Link to post
Share on other sites
But I already have a table with what I want on it. I dont see why I can take the existing and input it that way then making a whole new table.

Share this post


Link to post
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..

Share this post


Link to post
Share on other sites
Ehhhh, I guess I will figure somthing out. Just seems somthings get to hard when there easy. :P thanks much radar.

Share this post


Link to post
Share on other sites

×

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.