Hi,
Im not 100% sure what you really trying to do but i think you just want to give users a form where they can enter their personal details and when submiting you want to save them in a database and also you want them to give a ficility to edit their details right?
You can do this as two processes.
1. user registration
2. Edit user profile
user registration
In this process you can do what you have done, give them a form to enter their details and by submitting save the details in the database.
Edit user profile
I think this is where you got stuck. Well This is not that hard mate 🙂. Actually there are two ways to do this.
- public editing area where all the users will be listed and by selecting one he can edit his details. (specially in admin panels where main admin is responsible for keeping record of the users)
If your requirement is this, you can simply list all the users in a page (perhaps you can use pagination if there are lot of users) and provide a link called "edit" at the end of each user information. You can pass the "userId" fetching from the database.
EG:
name address
niroshan Sri lanka
<a href='editpage.php?id=userid>edit</a>
In the editing page you can query the databse using the GET value and display them in the appropriate textboxes. In case if you don't no how to display the values in the textboxes here an example,
*assume the result set name is $result
name : <input type='text' name='name' value='<?php echo $result['name']; ?>'>
- Allow users to edit their details when they logged into the system.
When a user logged in, you can assign his "userId" to a [B]session variable[/B] and by using that variable you can query the database in the edit user page and display the user details as shown above.
Hope this will help your question.
If you have any queries please let me know.
Thanx,
Regards,
Niroshan