• Advertisement
Sign in to follow this  

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

This topic is 4371 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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  -->

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement