This is a discussion on "Submit form results to file/folder" within the PHP Forum section. This forum, and the thread "Submit form results to file/folder are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Submit form results to file/folder
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
Submit form results to file/folder
How do i get my form results sent straight to a file/folder in my web directory. I need to be able to view results from submissions such as checkboxex, radio and text boxes without a new one overwriting the old one before i view it
HELP!!!!!!!!!!!! |
|
|
|
#2
|
|||
|
|||
|
Re: Submit form results to file/folder
Thats where mysql comes in. Everytime the form is submitted you enter that record into the db.
|
|
#3
|
|||
|
|||
|
Re: Submit form results to file/folder
Quote:
You could take the form info, for example, and email it to yourself so you would always have a 'hard copy' so to speak. Or, as has already been suggested, you could store the info in a database for future use. |
|
#4
|
|||
|
|||
|
Re: Submit form results to file/folder
If you want to write the contents of a feedback form to a directory on your server then just use the PHP file management commands, e.g. fopen, fwrite and fclose.
You can easily create a random file name on the fly each time and check it hasn't been created previously so that you don't overwrite existing files. Cheers Dan |
|
#5
|
|||
|
|||
|
PHP: I cannot save the form's content on file...
I cannot save the form's content on file (on the local directory where the html/php file is).
Both the HTML and the PHP parts seem to work when "isolated". When I combine them (to be able to save what has been inserted), it does not work. Thank you for any suggestion, Pietro <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"/> <title>Test</title> </head> <body> <form enctype="text/plain" method="POST" name="TestForm"/> <p /> Input anything: <input type="text" name="anything" value="Default"/> <br /> <input type="submit" value="OK" name="submit"/> </form> <?php $fh = fopen("form_output.txt", w); fwrite($fh, anything); fclose($fh); ?> </body> </html> |
|
#6
|
|||
|
|||
|
Re: Submit form results to file/folder
That's because you have no php code to collect the values that were 'POSTed'.
It would also have been better to have started a new thread with your query. |
|
#7
|
|||
|
|||
|
Re: PHP: I cannot save the form's content on file...
Quote:
Plenty else I could comment on, but that should get you started |
|
#8
|
||||
|
||||
|
Re: Submit form results to file/folder
Why don't you send the info to a unique database and review it, then export it either to a file or a permanent database?
It just seems like a good idea not to let users access your file system until you're really confident about your security skills. (I'm so chicken I don't upload anything to my files except by ftp.) |
|
#9
|
|||
|
|||
|
Re: Submit form results to file/folder
I cannot use a DB for many reasons.
This code should be closer to the right solution, but it does not work, yet:
All I need is the form contents on a local file (in the same directory where the html/php file is)... |
|
#10
|
|||
|
|||
|
Re: Submit form results to file/folder
What version of PHP are you using as you may need to change $_POST to $HTTP_POST_VARS.
|
![]() |
| Tags |
| submit, form, results, filefolder |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Submit options and open results in a new window | xshane | JavaScript Forum | 2 | May 21st, 2008 10:23 |
| Display results of a submit form (getting url) in same window?? | jahphill | JavaScript Forum | 12 | Nov 29th, 2007 00:18 |
| Multi file uploader and folder create | 737mechanic | PHP Forum | 1 | Sep 29th, 2007 11:03 |
| submit many forms - auto submit the same form many times | divs | JavaScript Forum | 0 | May 24th, 2007 10:10 |
| Folder and file management | pengyou | Starting Out | 4 | May 23rd, 2007 08:23 |