I can help.
First, get cgi-lib.
Then, you need to make the cgi file to process the form.
Put the cgi file in the same directory as the cgi-lib.pl file.
Then, put these lines in the beginning of the cgi file.
Code:
#!/usr/bin/perl
require "cgi-lib.pl";
&ReadParse(*input);
Now, for each form input, put a line with each input name.
Here, the input names are username and password.
Code:
$username = $input{'username'};
$password = $input{'password'};
Then, put lines like this to open the file
Code:
open(OUT, users.txt);
select(OUT);
The, write to the file
Code:
print "Username: $username";
print "Password: $password";
print "\n===========================\n\n";
Finally, add
I hope this helped. You would probably want to add a redirect of some sort, or just have a link back to the main form with a thank you message.
|