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

 



SaiyanM
User

Jun 4, 2001, 4:54 PM

Post #1 of 2 (665 views)
Help appreciated... Can't Post

Uhm, I made this guestbook quite a while ago and it worked when i made it first. After the first two or three days, it didnt work and a 500 internal server came up. Here is the code (guestbook.cgi)
!#/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">';

#######################
#Path to Sendmail on your server (Important for the CGI to send e-mails out).
$variables{'mailprog'} = "/var/qmail/bin/qmail-inject";

#######################
#E-mail Adress, the return one. (FOR IDIOTS: The one you want to be replied to in the e-mail that goes out to whoever signs the guestbook). *******Make sure there is a "\" before the "@". EX- #blah\@hotmail.com not blah@hotmail.com
$variables{'rmail'} = "SaiyanM\@hotmail.com";

########################
#The URL to the view.html file.
$variables{'view_URL'} = "http://saiyanh.virtualave.net/cgi-bin/guestbook/view.html";

#######################
#This lets people view file.
$variables{'view_file'} = "<a href="$view_URL">View the Guestbook</a>";

#end of variables#######################################################################################################################################################
#$variables{'copyright'} = "This script was made by ChibiGuy, of Saiyan Menacy. Do not steal it, or for that matter sell it, however... feel free to distribute this file in anyway. $variables{'view_file'}";
$variables{'copyright'} = "This script was made by ChibiGuy, of Saiyan Menacy. Do not steal it, or for that matter sell it, however... feel free to distribute this file in anyway. $variables{'view_file'}";
#$variables{'copyright'} = "This script was made by ChibiGuy, of Saiyan Menacy. Do not steal it, or for that matter sell it, however... feel free to distribute this file in anyway. $variables{'view_file'}";
#$variables{'copyright'} = "This script was made by ChibiGuy, of Saiyan Menacy. Do not steal it, or for that matter sell it, however... feel free to distribute this file in anyway. $variables{'view_file'}";
#$variables{'copyright'} = "This script was made by ChibiGuy, of Saiyan Menacy. Do not steal it, or for that matter sell it, however... feel free to distribute this file in anyway. $variables{'view_file'}";
#$variables{'copyright'} = "This script was made by ChibiGuy, of Saiyan Menacy. Do not steal it, or for that matter sell it, however... feel free to distribute this file in anyway. $variables{'view_file'}";
#$variables{'copyright'} = "This script was made by ChibiGuy, of Saiyan Menacy. Do not steal it, or for that matter sell it, however... feel free to distribute this file in anyway. $variables{'view_file'}";
#$variables{'copyright'} = "This script was made by ChibiGuy, of Saiyan Menacy. Do not steal it, or for that matter sell it, however... feel free to distribute this file in anyway. $variables{'view_file'}";
#$variables{'copyright'} = "This script was made by ChibiGuy, of Saiyan Menacy. Do not steal it, or for that matter sell it, however... feel free to distribute this file in anyway. $variables{'view_file'}";
#$variables{'copyright'} = "This script was made by ChibiGuy, of Saiyan Menacy. Do not steal it, or for that matter sell it, however... feel free to distribute this file in anyway. $variables{'view_file'}";
#$variables{'copyright'} = "This script was made by ChibiGuy, of Saiyan Menacy. Do not steal it, or for that matter sell it, however... feel free to distribute this file in anyway. $variables{'view_file'}";
#$variables{'copyright'} = "This script was made by ChibiGuy, of Saiyan Menacy. Do not steal it, or for that matter sell it, however... feel free to distribute this file in anyway. $variables{'view_file'}";
#$variables{'copyright'} = "This script was made by ChibiGuy, of Saiyan Menacy. Do not steal it, or for that matter sell it, however... feel free to distribute this file in anyway. $variables{'view_file'}";




randor
User

Jun 4, 2001, 5:58 PM

Post #2 of 2 (662 views)
Re: Help appreciated... [In reply to] Can't Post

try this:

!#/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 qq~
<table cellspacing="0" cellpadding="0" border="0" width="700"><tr><td bgcolor="black">
~;
#######################
#Path to Sendmail on your server (Important for the CGI to send e-mails out).
$variables{'mailprog'} = "/var/qmail/bin/qmail-inject";

#######################
#E-mail Adress, the return one. (FOR IDIOTS: The one you want to be replied to in the e-mail that goes out to whoever signs the guestbook). *******Make sure there is a "\" before the "@". EX- #blah\@hotmail.com not blah@hotmail.com
$variables{'rmail'} = "SaiyanM\@hotmail.com";

########################
#The URL to the view.html file.
$variables{'view_URL'} = "http://saiyanh.virtualave.net/cgi-bin/guestbook/view.html";

#######################
#This lets people view file.
$variables{'view_file'} = "<a href=\"$view_URL\">View the Guestbook</a>";

#end of variables#######################################################################################################################################################
#$variables{'copyright'} = "This script was made by ChibiGuy, of Saiyan Menacy. Do not steal it, or for that matter sell it, however... feel free to distribute this file in anyway. $variables{'view_file'}";
$variables{'copyright'} = "This script was made by ChibiGuy, of Saiyan Menacy. Do not steal it, or for that matter sell it, however... feel free to distribute this file in anyway. $variables{'view_file'}";
#$variables{'copyright'} = "This script was made by ChibiGuy, of Saiyan Menacy. Do not steal it, or for that matter sell it, however... feel free to distribute this file in anyway. $variables{'view_file'}";
#$variables{'copyright'} = "This script was made by ChibiGuy, of Saiyan Menacy. Do not steal it, or for that matter sell it, however... feel free to distribute this file in anyway. $variables{'view_file'}";
#$variables{'copyright'} = "This script was made by ChibiGuy, of Saiyan Menacy. Do not steal it, or for that matter sell it, however... feel free to distribute this file in anyway. $variables{'view_file'}";
#$variables{'copyright'} = "This script was made by ChibiGuy, of Saiyan Menacy. Do not steal it, or for that matter sell it, however... feel free to distribute this file in anyway. $variables{'view_file'}";
#$variables{'copyright'} = "This script was made by ChibiGuy, of Saiyan Menacy. Do not steal it, or for that matter sell it, however... feel free to distribute this file in anyway. $variables{'view_file'}";
#$variables{'copyright'} = "This script was made by ChibiGuy, of Saiyan Menacy. Do not steal it, or for that matter sell it, however... feel free to distribute this file in anyway. $variables{'view_file'}";
#$variables{'copyright'} = "This script was made by ChibiGuy, of Saiyan Menacy. Do not steal it, or for that matter sell it, however... feel free to distribute this file in anyway. $variables{'view_file'}";
#$variables{'copyright'} = "This script was made by ChibiGuy, of Saiyan Menacy. Do not steal it, or for that matter sell it, however... feel free to distribute this file in anyway. $variables{'view_file'}";
#$variables{'copyright'} = "This script was made by ChibiGuy, of Saiyan Menacy. Do not steal it, or for that matter sell it, however... feel free to distribute this file in anyway. $variables{'view_file'}";
#$variables{'copyright'} = "This script was made by ChibiGuy, of Saiyan Menacy. Do not steal it, or for that matter sell it, however... feel free to distribute this file in anyway. $variables{'view_file'}";
#$variables{'copyright'} = "This script was made by ChibiGuy, of Saiyan Menacy. Do not steal it, or for that matter sell it, however... feel free to distribute this file in anyway. $variables{'view_file'}";


you did not have the "END" at the end of your quote from line 55, so i guessed at where it should of gone and replaced it with the quoteword ~.. it should work now (as long as the print statement was suppose to end there..)

I Hope this helps...

perl programmers don't die.. they just start writing a new script.

 
 


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

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