Results 1 to 7 of 7

Thread: Recover data!!

  1. #1
    Join Date
    Apr 2006
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Recover data!!

    What can I do when I forgot one field of a form that is necessary and lost all data that I Input when I submit.
    How can I recover that data for submit correctly??

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Press the back button.

    Most browsers store the current form data (except the password) in memory for something like five pages away from the form in which it was entered.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Apr 2006
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I tried in Firefox and Maxthon with no results. A friend tell me that have a relation with header browser but he don´t know how to catch the data when submit or refresh the page!! Have you more ideias??

  4. #4
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by pavmoxo
    What can I do when I forgot one field of a form that is necessary and lost all data that I Input when I submit.
    How can I recover that data for submit correctly??
    Are you asking this question as a user, or as an author trying to help users that forget to include details?

    Mike

  5. #5
    Join Date
    Apr 2006
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Are you asking this question as a user, or as an author trying to help users that forget to include details?

    Mike
    As programmer for help users!!!

  6. #6
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by pavmoxo
    As programmer for help users!!!
    Have the PHP script handle both form generation and validation; submit the form to itself. If there errors, regenerate the form using the submitted values as the defaults (rather than the normal values), and insert error messages as appropriate.

    Mike

  7. #7
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Here's a simple example:
    PHP Code:
    <?php
    if ($_GET['var'] != "") {
       if (
    $_GET['var'] > 5) {
          
    $check 1;
          }
       }
    if (
    $check != 1) {
       if (
    $_GET['var'] != "") {
          echo 
    "Value not over 5. Please try again.<br>\n";
          }
       else {
          echo 
    "Please enter a value over 5.<br>\n";
          }
       echo 
    "<form action=\"\" method=\"get\"><br>\n".
       
    "<input type=\"text\" name=\"var\"><br>\n".
       
    "<input type=\"submit\" value=\"send\">\n".
       
    "</form>";
       }
    else {
       echo 
    "You entered a value over 5. Good job.";
       }
    Basically, that will write a form, and ask you to put in a value above 5. If you do, and submit, it says so. If not, then it will say you didn't, and leave your value in the textbox.

    The same ideas can be applied in a lot of ways.

    See: http://thebrb.com/stockpile?act=submit

    I wrote that using the same ideas.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •