-
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.
-
-
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
-
-
Thanks for the quick response! I will definitely look into what you've suggested.
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks