
slavdaddy
Deleted
Nov 4, 2000, 2:54 PM
Post #5 of 5
(10184 views)
|
Re: Need help on testing cgi on pc
[In reply to]
|
Can't Post
|
|
If all you are trying to do is take the input from the form, and put it in a file, then that is pretty simple. first, make your form send the info to the perl script: <form action='the url of your script here' method=GET> <input name=whatever type=text> </form> Then parse the query string: my $in; if ($ENV{'REQUEST_METHOD'} eq "GET") { $in = $ENV{'QUERY_STRING'}; } $in =~ s/%(..)/pack("c",hex($1))/ge; $in =~ s/\+/ /g; $in =~ s/\&/=/g; %formData = split (/=/, $in); } this puts the data in a hash. you can access it by: $formData{'whatever you named your inputs'}. now open a file: open(DATFILE, '>datfile.txt'); and print to the dat file, in thsi case our data is: print DATFILE $formData{whatever}; close the data file: close DATFILE; Now all of the stuff you posted is in your dat file. Hope this is what you were looking for. -Corey
|