Sid wrote:
I want to write data entered by users to a php/html/txt file.
Is this possible using jQuery?
Do you want this file to be on the server or on the user's machine?
If you want to save to the server, you will need to investigate your
server-side technology, be it PHP, Cold Fusion, Java, .NET, Python, or
whatever. You can also use server-side technologies to offer a file
download from data entered on the client. This should not be difficult.
In PHP (if I remember correctly :-) ) a form's action might point to a
page that looks like this:
<?php
// Load data from form, including $field1
header('Content-type: text/plain');
header('Content-Disposition: attachment; filename="output.text"');
?>
This text file contains this dynamic value: <?php echo $field1;?>
On the user's machine is significantly more difficult. The security
model of browsers is designed to stop malicious sites from knowing much
of anything about the user's machine, and access to the file system from
Javascript is a definite no-no. That said, it can be done, if the user
gives specific permission. See TiddlyWiki [1] for an example. But I
know of no jQuery tools to help with this. Anyone?
Cheers,
-- Scott
[1] http://tiddlywiki.com/