Chi Kien Uong
Geranienstraße 30
71034 Böblingen
Deutschland / Germany
|
If you are not registered or logged in, you may still use these forums but with limited features.
Show recent topics
|
|
|
Author |
Message |
04/01/2004 22:38:15
|
Anonymous
|
I'm NOT a perl programmer, but I have to edit a perl file. I know HTML in an out, but not Perl in the least! I updated all the files I saw for a course registration page: http://www.hcrhs.k12.nj.us/cgi-bin/ettc/courses.pl but after you click register and fill in the info (bogus info) it gives this message:
Unable to OPen file at /var/scohttp/cgi-bin/academy_regis.pl line 127.
Here is that file (is there something wrong???):
#!/usr/local/bin/perl
# academy_regis.pl
# edited 1-20-01 to setup for Groupwise auto respond.
# edited 2-12-01 to change file format (for future class lists)
require "cgi-lib.pl";
MAIN:
{
print &PrintHeader;
print "<body background=/gif/barodabg2.gif>";
print "<center><h1>Academy Course Registration Form</h1>";
print "<h4><strong>HCRHS - - 84 Route 31 - - Flemington, NJ - - 08822";
print "<hr></center>";
print "The following information has been sent to The Academy at Hunterdon Central. Please forward your check/purchase order (if required) to Dr. Judy Gray at the adress listed above";
print "</strong></h4>";
read (STDIN,$buf,$ENV{'CONTENT_LENGTH'});
@kvpairs = split(/&/,$buf);
# $newinfo = join (/:/,@kvpairs);
foreach $kv (@kvpairs) {
($key,$val) = split(/=/,$kv);
$val =~ tr/+/ /;
$val =~ s/%([a-fA-F0-9]{2})/pack("C",hex($1))/eg;
$formdata{$key}= $val;
}
print "<table border=4 cellpadding=3 cellspacing=5>";
print "<tr><td>";
print "<strong>Course</strong></td><td><strong>Starting Date</strong></td><td><strong>Time</strong></td></tr>";
print "<tr><td>";
print "$formdata{course1}</td><td>$formdata{date1}</td><td>$formdata{time1}</td></tr>";
print "<tr><td>";
print "$formdata{course2}</td><td>$formdata{date2}</td><td>$formdata{time2}</td></tr>";
print "<tr><td>";
print "$formdata{course3}</td><td>$formdata{date3}</td><td>$formdata{time3}</td></tr>";
print "</table>";
print "<br><strong><pre>";
print "Name - ",$formdata{realname};
print "<br>";
print "Address - ",$formdata{Address};
print "<br>";
print "City - ",$formdata{City};
print "<br>";
print "State - ",$formdata{State};
print "<br>";
print "Zip - ",$formdata{Zip};
print "<br>";
print "School - ",$formdata{School};
print "<br>";
print "School Address - ",$formdata{School_Address};
print "<br>";
print "Home Phone - ",$formdata{Home_phone};
print "<br>";
print "Work Phone - ",$formdata{Work_phone};
print "<br>";
print "E-mail - ",$formdata{email};
print "<br>";
print "</pre>";
print "</strong></center>";
print &HtmlBot;
}
# the mail routine
$mailprog="/usr/lib/sendmail";
$recipient='sschaffe@hcrhs.k12.nj.us';
open (MAIL,"|\/usr\/lib\/sendmail -t");
print MAIL "To: $recipient \n";
print MAIL "From: $formdata{email}\n";
$subj="CS:".$formdata{course1};
print MAIL "Subject: $subj \n\n";
print MAIL $formdata{realname}," has recently registered via our web site.\n";
print MAIL "\n Here is the data he/she supplied:\n\n";
print MAIL "course #1 - ",$formdata{course1};
print MAIL "\n";
print MAIL "start date - ",$formdata{date1};
print MAIL "\n";
print MAIL "time - ",$formdata{time1};
print MAIL "\n---------------------";
print MAIL "\n\n";
print MAIL "course #2 - ",$formdata{course2};
print MAIL "\n";
print MAIL " ",$formdata{date2};
print MAIL "\n";
print MAIL " ",$formdata{time2};
print MAIL "\n\n---------------------";
print MAIL "\n\n";
print MAIL "course #3 - ",$formdata{course3};
print MAIL "\n";
print MAIL " ",$formdata{date3};
print MAIL "\n";
print MAIL " ",$formdata{time3};
print MAIL "\n\n---------------------";
print MAIL "\n\n";
print MAIL "Name - ",$formdata{realname},"\n";
print MAIL "Address - ",$formdata{Address},"\n";
print MAIL "City - ",$formdata{City},"\n";
print MAIL "State - ",$formdata{State},"\n";
print MAIL "Zip - ",$formdata{Zip},"\n";
print MAIL "School - ",$formdata{School},"\n";
print MAIL "School Address - ",$formdata{School_Address},"\n";
print MAIL "Home Phone - ",$formdata{Home_phone},"\n";
print MAIL "Work Phone - ",$formdata{Work_phone},"\n";
print MAIL "E-mail - ",$formdata{email},"\n";
print MAIL "Remote Host IP - ",$ENV{REMOTE_ADDR},"\n";
close (MAIL);
$recipient='sschaffe@hcrhs.k12.nj.us';
open (MAIL,"|\/usr\/lib\/sendmail -t");
print MAIL "To: $recipient \n";
print MAIL "From: $formdata{email}\n";
$subj="CS:".$formdata{course1};
print MAIL "Subject: $subj \n\n";
print MAIL $formdata{realname}," has recently registered via our web site.\n";
print MAIL "\n Here is the data he/she supplied:\n\n";
print MAIL "course #1 - ",$formdata{course1};
print MAIL "\n";
print MAIL "start date - ",$formdata{date1};
print MAIL "\n";
print MAIL "time - ",$formdata{time1};
print MAIL "\n---------------------";
print MAIL "\n\n";
print MAIL "course #2 - ",$formdata{course2};
print MAIL "\n";
print MAIL " ",$formdata{date2};
print MAIL "\n";
print MAIL " ",$formdata{time2};
print MAIL "\n\n---------------------";
print MAIL "\n\n";
print MAIL "course #3 - ",$formdata{course3};
print MAIL "\n";
print MAIL " ",$formdata{date3};
print MAIL "\n";
print MAIL " ",$formdata{time3};
print MAIL "\n\n---------------------";
print MAIL "\n\n";
print MAIL "Name - ",$formdata{realname},"\n";
print MAIL "Address - ",$formdata{Address},"\n";
print MAIL "City - ",$formdata{City},"\n";
print MAIL "State - ",$formdata{State},"\n";
print MAIL "Zip - ",$formdata{Zip},"\n";
print MAIL "School - ",$formdata{School},"\n";
print MAIL "School Address - ",$formdata{School_Address},"\n";
print MAIL "Home Phone - ",$formdata{Home_phone},"\n";
print MAIL "Work Phone - ",$formdata{Work_phone},"\n";
print MAIL "E-mail - ",$formdata{email},"\n";
print MAIL "Remote Host IP - ",$ENV{REMOTE_ADDR},"\n";
close (MAIL);
# open file to keep data
open(FOO,">>/u/httpdocs/academy/regis.dat") || die("Unable to OPen file ");
print FOO $buf,"\n";
close(FOO);
|
|
05/01/2004 09:11:41
|
Anonymous
|
u/httpdocs/academy/regis.dat is a totally different path than what your error path message is. I would change that path to reflect the true location of regis.dat
probably should be /var/scohttp/cgi-bin/regis.dat
|
|
05/01/2004 22:44:03
|
Auron
Expert
Joined: 23/06/2003 22:02:17
Messages: 1053
Offline
|
Anonymous wrote:u/httpdocs/academy/regis.dat is a totally different path than what your error path message is. I would change that path to reflect the true location of regis.dat
probably should be /var/scohttp/cgi-bin/regis.dat
should be /var/scohttp/academy/regis.dat
|
Visit my site @ www.ragnaru.com
Adv. Poll Install Guide NOW BACK ONLINE! (And also rather out of date I would of thought) |
|
|
|
|
|
Based on the open source JForum
|