If you want the data to be written to your server, you need a server-side script; the data can be sent by an html form to the script.
Parsing the cgi data (so that your script can process the data input by the user) is possible using a shell script, but is simpler in perl or php.
An example of a simple perl cgi script that will append the contents of a html form's text box to the file "txtdata":
Code:
#!/usr/bin/perl
use CGI::Pretty ':standard';
my $txt=param('txt'); #Gets the data from the textarea named "txt"
print "Content-type: text/html\n\n";
print '<html>
<head><title>Foo</title></head>
<body> ';
if (!$txt) { #This page wasn't sent any text, so it prints a form for user to enter it
print 'Enter Text: <br>
<form action="" method="post">
<textarea name="txt" rows="10" cols="42"></textarea><br>
<input type="submit" value="Submit">
</form>
';
} else { #Appends the contents of $txt (sent by form) to file
open(F,'>>txtdata');
print F "$txt\n";
print "Text Written";
close F;
}
print '
</body>
</html>';
Other form elements can be processed in a similar manner, depending on your needs.