CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Help please

 



SaiyanM
User

May 1, 2001, 12:27 PM

Post #1 of 2 (474 views)
Help please Can't Post

I created this guestbook, and I dont know why i get a 500 internal server error. I tried CHMOD'ing it to 755 and it still didnt work. The script debugger said "no recent CGI errors logged" Here is the code...

!#/usr/local/bin/perl

##########################################
# ChibiGuy Guestbook Script
# 1999-2001, Copyrighted by Saiyan Menacy
#
# Do NOT sell this script, distribute it in
# any way, or you'll be persecuted to the fullest
# extent of the law ... ?
#
# If you found this script, do me a favor and
# remove it from your hardrive..!
# E-mail: SaiyanM@hotmail.com
###########################################

#####Let's Gather the Variables, shall we?
require "variables.cgi";
$header_URL = "$variables{'header_URL'}";
$footer_URL = "$variables{'footer_URL'}";
$mailprog = "$variables{'mailprog'}";
$remail = "$variables{'rmail'}";
$copyright = "$variables{'copyright'}";

#####Let's get the "other" variables.
use CGI qw/:standard/;
$name = param('name');
$email = param('email');
$url = param('url');
$sitename = param('sitename');
$message = param('message');
$localtime = localtime;
$IP = $ENV{REMOTE_ADDR};


#####Let's try this e-mail thingamajiggy
sub e_mailPERSON{
open (MAIL,"|$mailprog -t");
print MAIL "To: $email\n";
print MAIL "From: $rmail\n";
print MAIL "Reply-To: $rmail\n";
print MAIL "Subject: Thanks For Signing Anime Apocalypse's Guestbook\n\n";
print MAIL "You submitted the following information\n\n";
print MAIL "Name: $name\n";
print MAIL "E-Mail Adress; $email\n";
print MAIL "Site Name: $sitename\n";
print MAIL "Site URL: $url\n";
print MAIL "Message: $message\n\n";
print MAIL "Again, Thanks for signing My Guestbook";
close (MAIL);
}


#####What better to do, than to add the entry?
open(FILE, ">>/data1/virtualave.net/saiyanh/public_html/cgi-bin/guestbook/messages.txt");
print FILE<<END;

<table cellspacing="0" cellpadding="0" border="0" width="700"><tr><td bgcolor="black">
<table cellspacing="1" cellpadding="1" width="100%">
<tr><td rowspan="2" bgcolor="gray" width="150"><center><font size="2" face="Arial" color="black"><b> $name</b>
<font size="1">$localtime </td><td bgcolor="gray"><font size="2" face="Arial" color="black"><b><a href="mailto:$email">$name</a> wrote:</td></tr>
<tr><td bgcolor="silver"><font size="2" face="arial" color="Black"><center><a href="$url">$sitename, $url</a></center>
<div align="center>"><table width="95%"><tr><td><font size="1">$message</td></tr></table></div></td></tr></table>
</td></tR></table>




END
close(FILE);



#####We can't let you leave without us thanking you!
print "Content-type: text/html\n\n";
print <<THANKYOU;

Thanks for signing my guestbook, Here is what you added to my guestbook: (By the way, you signed the guestbook at $localtime.

<b>NAME</b>: $name<bR>
<b>E-MAIL:</b> $email

<b>URL OF WEBSITE:</b> $url

<b>NAME OF WEBSITE: </b> $sitename

<b>Message:</b> $message




<b>$copyright</b>



Now That you've signed the guestbook, go take a look at the guestbook itself at <a href="/cgi-bin/guestbook/view.html"> here </a>.

THANKYOU
&e_mailPERSON;





Jasmine
Administrator / Moderator

May 1, 2001, 1:55 PM

Post #2 of 2 (471 views)
Re: Help please [In reply to] Can't Post

The first line of your script (the path to perl) looks messed up. It is:


Code
!#/usr/local/bin/perl

it should be


Code
#!/usr/local/bin/perl


 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives