Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    New to the CF scene
    Join Date
    Sep 2011
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Need help saving HTML form using php to a text file

    So I have created an HTML form with check boxes and text fields. I want to know how make it so when the user clicks save the form submits to a php page, which then saves to a text file. I then want it so that when they return from another computer or someone else goes to the form the results that were put in last time are already selected/typed in. I need to know how to setup the text file and how to setup the php. Also info on if I should apply [CODE]class="1" id="1" name="1"[ICODE]. Which one should I use. Even if no one can figure out how have the form data there when someone comes back, the saving would be helpful. My email is <html><a href mailto: alex.taffe@gmail.com>alex.taffe@gmail.com</a></html>

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,471
    Thanks
    8
    Thanked 1,085 Times in 1,076 Posts
    Does that mean each person will be able to overwrite (or change) the data in the form?
    Or does it have to remember different data for different people?


    .

  • #3
    New to the CF scene
    Join Date
    Sep 2011
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re:

    I want anyone to be able to change it. (i am going to have multiple forms) but it doesn't matter that anyone can change it for what I am doing. I am giving great thanks in advance

  • #4
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,471
    Thanks
    8
    Thanked 1,085 Times in 1,076 Posts
    Show me the form you already have ... the HTML form that needs to
    be re-populated with previous data.

  • #5
    New to the CF scene
    Join Date
    Sep 2011
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

  • #6
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,471
    Thanks
    8
    Thanked 1,085 Times in 1,076 Posts
    Seeing what you've done ... That's a lot of information.

    Since I'm guessing you'll want the ability to make different forms,
    I would re-think the whole concept of how the form is created to begin with.
    You would not need to hand-code a form page each time you need a different form.

    I would create a database for the actual form questions.

    CATEGORY|ACTUAL QUESTION|HOW MANY CHECKS|INFO

    PATIENT CARE|Accurately Identifies Chief Complaint (direct observation)|3||
    PATIENT CARE|Accurately acquires HPI to characterize pain (direct observation)|2|Must identify location, quality, intensity, duration, radiation, timing, exacerbating/ relieving factors, and associated symptoms.|

    etc.

    Each line is one question that tells you which category it is, the question itself, how many checkboxes to make, and the info (if any).

    You build this .txt for for each form you make. You can cut and paste different lines from one form to another.

    Then, one PHP script opens the appropriate .txt form file and generates your form.
    It breaks apart the categories, numbers the questions, and creates the necessary HTML checkboxes, comment box, etc.
    The categories and questions are numbered in the order in which they appear in your form .txt file.
    You could even use Google Docs (spreadsheet) to create your form files (online and free).

    =============

    Now, back to your original idea of saving the form information.

    This of course depends on how the form is generated. The PHP generation script
    needs to have a scheme for naming your checkboxes and comment boxes.

    I'm still so puzzled as to why you wish to redisplay the form with the data for
    anyone to overwrite ... I can't figure out why that would happen.

    But ... alas ... what you have is too hard for me to script in less than one hour.
    I would do it for a fee, but I just don't have the time to script this for free.

    This is a big project ... beyond the scope of using this forum.


    .
    Last edited by mlseim; 09-06-2011 at 03:08 AM.

  • #7
    New to the CF scene
    Join Date
    Sep 2011
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I realize that the form is huge, but could you write a quick script with like two checkboxes and one text box. And does this go in the .txt file
    CATEGORY|ACTUAL QUESTION|HOW MANY CHECKS|INFO
    I am no familiar with MySQL. I hope .txt can be used for this. Like I said, a quick example is all I need, if you could just email me the .html, .txt, and .php to me I could easily replicate it, as I do realize the scale of this project. My email is alex.taffe@gmail.com

  • #8
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,471
    Thanks
    8
    Thanked 1,085 Times in 1,076 Posts
    Maybe this evening I might be able (USA central time).

  • #9
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,471
    Thanks
    8
    Thanked 1,085 Times in 1,076 Posts
    I'm stuck on a question again ...

    Why are you using checkboxes?
    With that, they can check more than one box?

    Did you mean to use "radio buttons" instead?
    So they can only pick one for each question?


    .


  •  

    Posting Permissions

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