Results 1 to 3 of 3

Thread: Fill HTML Form from Multiple Text Files

  1. #1
    Join Date
    Aug 2009
    Posts
    15
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Fill HTML Form from Multiple Text Files

    Hello,

    How would I go about filling an HTML form dynamically based upon which text file was selected to fill it? (the text file would be chosen via a link)

    Hope this makes sense...

    Thanks in advance!

    - Jenn
    Last edited by pelaej; 08-11-2010 at 01:23 PM.

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

    Default

    Somehow you would identify the filename. For example, the user could submit the filename directly but this would be a security problem. Alternatively you could create a list (array) of files using a code (the filename, an ID number, anything you'd like) and then search that list. Look into arrays in PHP for this. They are a little hard to learn/use the first time, but they are very useful and not extremely difficult.

    Then once you know the path of that file, you can just use file_get_contents(MYFILE) and echo that into wherever you'd like on the page.
    Last edited by djr33; 08-10-2010 at 07:30 PM.
    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

  3. #3
    Join Date
    Aug 2009
    Posts
    15
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    Thanks for the quick response! I will definitely look into what you've suggested.

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
  •