Jump to content
  • Advertisement
Sign in to follow this  
TravelingCoder

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

This topic is 4547 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
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!