display and edit simultaneously

I have some data saved in a mysql table. Say names and addresses of customers. I want my customers to be able to see their own information on a form and be able to go right there and change the address for example and save it by clicking the save button. How do I do this in one step? Any help is greatly appreciated.

Faris

Create a query that will pull specific persons information.

Then create a form with all the fields need to hold that specific information.
Then populate that form with the data.

Then when they click the save button you could have the page submit to itself and just run an if statement that check that your save button was set and if so run the appropriate update query with the new information.

Thank you so much. The part i tried based on your help worked. I will try the rest of it too (save part) .

Your reply to my last question helped me and resolved my problem. I learned a lot from it. Thank you.

I have posted a new question, but thought asking you directly also. I hope you don’t mind. Here is my question:

I display contents of a table using echo. Size of ecah cutomer’s table is variable. Some could be only one record and some could be hundreds. I use a code similar to the following:

<? echo $name ?>

<td width="30%" align="center" bordercolor="#C0C0C0"><font face="Arial Narrow" color="#0066cc" size="2"><? echo $soc ?></font>&nbsp;</td>

<td width="10%" align="left" bordercolor="#C0C0C0">
<p align="center"><font size="2" face="Arial Narrow" color="#FF0000"><a href=edit.php>Edit</font></a></td>

My objective is for the user to be able to click on the “Edit” link and be directed to a form to allow him/her to edit the information (Name and social security number e.g.). Is there any way to write a code which can take the displayed soc. sec. number in that particular line from the displayed text so that the information about the correct employee is displayed in the subsequent form when invoked?

Or is this a Java issue?

Thanks in advance for any help you can give.

I am not quite sure I full understand the question, or more or less, exactly what you trying to do, but, I will give it a shot…

Here is what I interpret your question:

You want to take values from one form to another form which is located on another page entirely.

If this is the case you will want to look into sessions.
These are 2 important parts of sessions.

start_session()
$_SESSION[’’]

Use http://www.php.net for more information on these.

Hope that helps.

Sponsor our Newsletter | Privacy Policy | Terms of Service