Form Has Memory

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • battle.chris@gmail.com

    Form Has Memory

    Hello.

    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?

  • rich

    #2
    Re: Form Has Memory

    Can you show the code?

    Comment

    • Carl Vondrick

      #3
      Re: Form Has Memory

      battle.chris@gm ail.com wrote:[color=blue]
      > 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[/color]
      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
      Web-Enginner
      Professor of Computer Science at Columbia University, researching computer vision, machine learning, and AI applications.

      To contact me, please use my website.

      Comment

      • Jim Carlock

        #4
        Re: Form Has Memory

        battle.chris@gm ail.com wrote:[color=blue]
        > 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[/color]

        "Carl Vondrick" <spammers@suck. com> replied:[color=blue]
        > 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.[/color]

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

        Jim Carlock
        Post replies to the group.


        Comment

        • Terry

          #5
          Re: Form Has Memory

          battle.chris@gm ail.com wrote:[color=blue]
          > Hello.
          >
          > 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?
          >[/color]

          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_q uery($query) or die('Query 1 failed: ' . mysql_error());
          $row=mysql_fetc h_array($result ,MYSQL_NUM);
          $num=mysql_num_ rows($result);
          $row[4]=htmlspecialcha rs($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\"
          value=\"$row[4]\">

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

          HTH
          --
          TK

          Still Having a Ball










          ..

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

          Comment

          Working...