Forum Moderators: open

Message Too Old, No Replies

Forms: Writing to a file that can't be read

         

MatthewHSE

7:50 pm on Sep 9, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi everyone,

I'm trying to create a form that will save the results to another file (either .txt or .csv). I need the form to have access to the file so it can write to it, but I need the file to be totally inaccessible in any other way, except by providing a password. (I'm using it for people to send their names and addresses for mailing list purposes, and I obviously need to keep that info private.)

Does anyone know how to accomplish this? I'm kind of stuck. Tried some online tutorials, but they only showed the HTML tags for form fields and didn't go into what I need to know.

Thanks,

Matthew

dougmcc1

8:28 pm on Sep 9, 2003 (gmt 0)

10+ Year Member



You need something more advanced than HTML in order to write to a file. As far as password protecting that file, just put it into a password protected directory.

MatthewHSE

8:36 pm on Sep 9, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Okay, any recommendations for a good script that will write to a file? Also, how do I write to a file in a password-protected directory without making the password available somehow to prying eyes?

Thanks again,

Matthew

dougmcc1

8:55 pm on Sep 9, 2003 (gmt 0)

10+ Year Member



Well I do it with PHP. You put your form in your root directory or wherever it's available to your visitors. Then you put your script in a password protected directory. Your form calls the script from the password protected directory, but if your users try to go to it, they are prompted for a username and password.

To get the PHP code to do this, try searching for "php file append" on your favorite SE.

<added>Here ya go:
[aardvarkind.com ]
</added>