OT: nooB html form question

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I want to use a simple form with a checkbox either on or off and store the
results to a text file, with minimal overhead.  Very ignorant about this
stuff so be gentle!  I have IIS running (but no front page or php) on a
windows machine.

Scope: "MyPage.Html" displays form with one checkbox reading default value
from text file (MyFormData.Txt) in same folder.  If user changes value of
check box and hits submit it logs those results to MyFormData.Txt
over-writing the previous contents.

What is the simplest way to accomplish?  Sample code would be much

Thanks in advance.

- Ben

Re: OT: nooB html form question

Something like this:

if (isset($_POST['checkbox'])) {
file_put_contents($_POST['checkbox'], 'MyFormData.Txt');
echo '<input type="checkbox" name="checkbox"';
if (file_get_contents('MyFormData.txt')) echo 'checked="checked"';
echo '>';

But does this code example really help you?

Re: OT: nooB html form question

This gets me started thank you.  I will tie the tex file name to the user  
login so they can only write to their own file.

Thank you very much for the reply.

Quoted text here. Click to load it

Re: OT: nooB html form question

JWBlue wrote:

Quoted text here. Click to load it

while the code posted by another contributor will work, is it what you are  
trying to accomplish - what happens when you have hundreds of users  
hitting that page - some concurrently.  Not sure what you are looking for,  
but FWIW, I would find another way....

Site Timeline