Form Has Memory

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I'm trying to fill form fields with values from a mysql record using
php. The problem is that when I move to a new record, the form still
displays the old data! The html source is updated but the previous
record is still displayed even after hitting refresh. Running the code
in a new window shows the correct result until I move to a new record.

Any ideas?

Re: Form Has Memory

Can you show the code?

Re: Form Has Memory wrote:
Quoted text here. Click to load it
This is probably a problem with your browser -- it's auto-filling the form.  
Try turning that off or check it in a low-fi browser.

Carl Vondrick
To contact me, please use my website.

Re: Form Has Memory wrote:
Quoted text here. Click to load it

Would a pragma no-cache header help? Or a meta expires header?

Jim Carlock
Post replies to the group.

Re: Form Has Memory wrote:
Quoted text here. Click to load it

I have a form built to insert/modify/delete records.  If you do not  
enter an id number, you insert a new record. If you enter an id you get  
the record inserted in the form values ready to modify.  When you submit  
  it checks that the New id == Old id and if yes modifies the record.

This form is for one user only - the only security is obscurity.

$query="SELECT * FROM `clyde` WHERE id=$id";
     $result=mysql_query($query) or die('Query 1 failed: ' . mysql_error());
            $row[4]=htmlspecialchars($row[4], ENT_QUOTES);

This is the <form> which posts then comes back with the changed data.  
When you enter a new id, submit, you get the new record ready to change.

<label>Sizes </label><input type=\"text\" id=\"sizes\" name=\"sizes\"  

<input type=\"hidden\" name=\"oldid\" value=\"$id\">
That allows (with an if statement) the record to be modified.

Still Having a Ball


----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==---- The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----

Site Timeline