Dear Sirs,

   I am new to cgi and i am using perl with it to study. What i'm doing now is im 
making an interactive site which requests for the name/text then the perl/cgi script 
will process it upon submitting the submit button and the output will be displayed via 
html. My problem is that i can't able to log the inputted text on the text file... 
though the inputted text can be seen from the reply via html....

   Here is the html script:

<!test.html>
<HTML>
<HEAD><TITLE>Test: Write to a file</TITLE></HEAD>
<BODY BASEFONT=5>
<FORM ACTION="http://192.168.1.1/cgi-bin/chap05/test.cgi"; METHOD=POST>
Name:<INPUT TYPE=text NAME=Test><BR><BR>
<INPUT TYPE=submit VALUE="Submit Name">
</FORM>
</BODY>
</HTML>


   Here is the perl script i copied from a book:

#!/usr/bin/perl
print "Content-type: text/html\n\n";
use CGI qw(:all -debug);
use strict;


#Declaration of variable
my($test);

#Assignment to variable
$test = param('Test');

#save form data to a file test.txt
open(OUTFILE, ">>", "/home/markus/cgi-bin/chap05/test.txt") || die "Error: $!";
print OUTFILE "$test\n";
close(OUTFILE);

print "<HTML><HEAD><TITLE>Test: Write to a file</TITLE></HEAD>\n";
print "<BODY><H1>Thank you $test...</H1></BODY></HTML>";


I know someone help me with this... Pls help...

Regards.....
-- 
______________________________________________
http://www.linuxmail.org/
Now with e-mail forwarding for only US$5.95/yr

Powered by Outblaze

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to