Mark Anthony Sioting [mailto:[EMAIL PROTECTED] 
: 
: 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>

[climbs on high horse]

    While almost all browsers recognize this, the standard
calls for attribute to be quoted. *All* attributes:

<BODY BASEFONT="5">

: <FORM ACTION="http://192.168.1.1/cgi-bin/chap05/test.cgi"; METHOD=POST>

<FORM ACTION="http://192.168.1.1/cgi-bin/chap05/test.cgi"; METHOD="POST">

: Name:<INPUT TYPE=text NAME=Test><BR><BR>

<INPUT TYPE="text" NAME="Test">

: <INPUT TYPE=submit VALUE="Submit Name">

<INPUT TYPE="submit" VALUE="Submit Name">

[climbs down from horse]

: </FORM>
: </BODY>
: </HTML>
: 
: 
:    Here is the perl script i copied from a book:
: 
: #!/usr/bin/perl

    Add these lines:

    use warnings;
    use CGI::Carp 'fatalsToBrowser';


: 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: $!";

    There is probably something going wrong here.
The line we added to the top of the script should
print the error to the browser. Come back and let
us know what the error is.


: 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>";


HTH,

Charles K. Clarkson
-- 
Head Bottle Washer,
Clarkson Energy Homes, Inc.
Mobile Home Specialists
254 968-8328


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

Reply via email to