Welcome to WebmasterWorld Guest from 50.19.0.90

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

User CP

     
4:05 am on Mar 22, 2008 (gmt 0)

Junior Member

5+ Year Member

joined:Feb 6, 2008
posts: 94
votes: 0


I have a login/register pages and like it shows what your logged in at the top like "Welcome {username}" and stuff, but how would I make it so a user can edit his information like his password, or his birthday or something?
4:23 am on Mar 22, 2008 (gmt 0)

Senior Member

WebmasterWorld Senior Member drdoc is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 15, 2002
posts:6807
votes: 0


You store the info in a database, and you provide a HTML form page. You populate the form with the user's info, and upon submittal you store the information in the database.
4:24 am on Mar 22, 2008 (gmt 0)

Junior Member

5+ Year Member

joined:Feb 6, 2008
posts: 94
votes: 0


WOW rofl I know that I need to make it so you can only edit your own information when your logged in only.
4:50 am on Mar 22, 2008 (gmt 0)

Senior Member

WebmasterWorld Senior Member eelixduppy is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Nov 12, 2005
posts:5966
votes: 0


tr8er8, I think you might have misunderstood DrDoc's response.

You have information stored in a database for each user of your site. When they login, you should have a similar form to the registration form that gets populated from the data you have for that specific user in your database so that they can make any necessary changes to their information. Upon submitting this form, a query will be sent to the database that will properly UPDATE the table with the new information.

First implement a form that grabs the data from the table and puts it into its respective input fields. Then, build the update query properly and you should be fine. There are a few examples of how this can be done floating around webmasterworld somewhere, so a little search might help you get started.

5:01 am on Mar 22, 2008 (gmt 0)

Junior Member

5+ Year Member

joined:Feb 6, 2008
posts:94
votes: 0


I already did search, what I need is just a php script that can allow it to detect what row the user logged in is, and get all the information for that row. Then Im good from there :)
5:14 am on Mar 22, 2008 (gmt 0)

Senior Member from MY 

WebmasterWorld Senior Member vincevincevince is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Apr 1, 2003
posts:4847
votes: 0


Read about Sessions and MySQL's SELECT command - that'll get you closer
5:14 am on Mar 22, 2008 (gmt 0)

Senior Member

WebmasterWorld Senior Member eelixduppy is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Nov 12, 2005
posts:5966
votes: 0


You should probably be storing the username or ID in a session variable or cookie, in which case you can use that to access the specific row that you need. For instance, a query could look something like the following:

$query = "SELECT * FROM `table_name` WHERE `username` = '".mysql_real_escape_string($_SESSION['username'])."'";

I'm afraid you aren't going to be finding a ready-made script for something like this; you are going to have to do most of this coding, while not a lot, by yourself. Of course, if you need help along the way don't hesitate to ask, but I'd like you to kindly try to implement your own solution first and then we can work from there.

5:25 am on Mar 22, 2008 (gmt 0)

Junior Member

5+ Year Member

joined:Feb 6, 2008
posts:94
votes: 0


Wow thanks elix that is what I needed and yes I have the session and all that set thanks!
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members