Jump to content


Photo

Making Login help.


  • Please log in to reply
8 replies to this topic

#1 HaZaRd420

HaZaRd420
  • Members
  • PipPipPip
  • Advanced Member
  • 37 posts

Posted 05 September 2006 - 01:35 AM

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.

#2 radar

radar
  • Members
  • PipPipPip
  • Advanced Member
  • 645 posts
  • LocationSLC

Posted 05 September 2006 - 01:56 AM

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...

#3 HaZaRd420

HaZaRd420
  • Members
  • PipPipPip
  • Advanced Member
  • 37 posts

Posted 05 September 2006 - 02:02 AM

Well not edit the ID but im saying point the Login to the ID so I can edit the rest of the fields.

#4 radar

radar
  • Members
  • PipPipPip
  • Advanced Member
  • 645 posts
  • LocationSLC

Posted 05 September 2006 - 02:10 AM

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?

#5 HaZaRd420

HaZaRd420
  • Members
  • PipPipPip
  • Advanced Member
  • 37 posts

Posted 05 September 2006 - 02:28 AM

Yes radar. Thats exactly what im getting at. So is this possible?

#6 Wintergreen

Wintergreen
  • Members
  • PipPipPip
  • Advanced Member
  • 107 posts

Posted 05 September 2006 - 03:38 AM

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. 

#7 HaZaRd420

HaZaRd420
  • Members
  • PipPipPip
  • Advanced Member
  • 37 posts

Posted 05 September 2006 - 04:12 AM

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.

#8 radar

radar
  • Members
  • PipPipPip
  • Advanced Member
  • 645 posts
  • LocationSLC

Posted 05 September 2006 - 04:16 AM

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..

#9 HaZaRd420

HaZaRd420
  • Members
  • PipPipPip
  • Advanced Member
  • 37 posts

Posted 05 September 2006 - 04:19 AM

Ehhhh, I guess I will figure somthing out. Just seems somthings get to hard when there easy. :P thanks much radar.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users