I am working on a member system at the moment.
I have for my database table the following fields...
id
email
password
The thing that I am trying to do is to create a form with a script to let the user update the information. I would like the form to post to self.
How would I go about doing this?
Thanks in advance.
Update Information...
Moderator: General Moderators
Re: Update Information...
assume this is example.php:lostprophetpunk wrote:The thing that I am trying to do is to create a form with a script to let the user update the information. I would like the form to post to self.
Code: Select all
<?php
//code to handle the form here
?>
<form action="example.php" method="post">
<!-- Form information here -->
</form>
-
lostprophetpunk
- Forum Newbie
- Posts: 21
- Joined: Sat May 31, 2008 3:49 am
Re: Update Information...
I know how to do the form.
It is just the code for updating the user information that I do not know. As you have to be able to update the table with new information, thus making it so that the user can edit their information.
It is just the code for updating the user information that I do not know. As you have to be able to update the table with new information, thus making it so that the user can edit their information.
Re: Update Information...
So here is how I handle this (example.php):lostprophetpunk wrote:It is just the code for updating the user information that I do not know. As you have to be able to update the table with new information, thus making it so that the user can edit their information.
Code: Select all
<?php
//insert form handle code here
$q = "Select * from "..... //put the code there to get the user info
$result = mysql_query($q);
$user_info = mysql_fetch_array($result);
?>
<form action="example.php" method="post">
<input type="text" name="name" value="<?php echo $user_info['name'] ?>">
</form>