[web] Appending user submission to a file [perl]

Started by
-1 comments, last by TravelingCoder 18 years ago
What is the problem with the following perl code?

#!/usr/local/bin/perl
#
# Author name:
# Creation date:
#
# Description:
#
require "cgi-lib.pl";
&ReadParse(*input);


$site_data="book.htm";


open(DAT,">>$site_data") || die("Cannot open file");
$first_name = $input{'first'};
$last_name = $input{'last'};
$email = $input{'email'};
$homepage_url = $input{'url'};
$comment = $input{'comment'};





print DAT "$first_name $last_name $email $homepage_url $commment \n";
 
close(DAT);




I keep getting the following error:

Status: 302 Found Location: /bin/error?error=Your%20script%20produced%20this%

20error%3A%20%3Cbr%3Ecgi-lib.pl%3A%20Unknown%20Content-type%3A%20 

URI: /bin/error?error=Your%20script%20produced%20this%20error%3A%20%3Cbr%3Ecgi-

lib.pl%3A%20Unknown%20Content-type%3A%20 Content-type: text/html 

Here is the HTMl form:

<!-- \/ starthtml -->
<html>
 <head>
  
   <TITLE></TITLE>
 </head>
<body bgcolor="#FFFFFF" text="#000000" link="#0000EE" vlink="#551A8B">

<form method="post" action="/cgi-bin/script.cgi">
<input type="text" name="first">
<input type="text" name="last">
<input type="text" name="email">
<input type="text" name="url">
<textarea name="comment"></textarea>
<input type="submit">
</form>



</body>
</html>
<!-- /\ end html  -->

And Dave did see the ad of penis enlargement, and gazing upon His holy manhood, He did thrust the spam into the firey depths of hell.- Book of Dave, 1:7

This topic is closed to new replies.

Advertisement