PDA

View Full Version : Help! with CGI/Perl


dee19802000
11-03-2003, 08:03 PM
hey,

I am having bif problems using cgi/perl. I am trying to get my paths right when i call "loadVariables("http://members.lycos.co.uk/owawa/cgi-bin/form.cgi", "0", "POST"); it doesn't call the script. I tried changing the paths in the cgi script too, using "#!/usr/bin/perl" and "/usr/bin/perl". My scripts are in the cgi-bin and are chmodd to 755. This doesnt seem to work for me at all, if anyone can help me please do. I know its got to be something wrong with my paths but if anyone knows whats wrong with it give us a shout!

:)

DEE

JHallam
11-03-2003, 08:11 PM
Can you access your CGI script via the browser? (Most don't let you, I know but just wondered if you can, so we know the cgi program is running)

JHallam
11-03-2003, 08:15 PM
Yes, you can...which cgi script are you using?

http://members.lycos.co.uk/owawa/cgi-bin/ but which cgi you using?

dee19802000
11-03-2003, 08:19 PM
im using one i got with a tutorial. if i post it up could you have a look at it?

dee19802000
11-03-2003, 08:22 PM
it's called "snowMailPerl.cgi"

freddycodes
11-03-2003, 10:14 PM
Are you sure you have perl installed and configured on your server. Because I should NOT be able to see this.

Luckily you do not have any usernames and passwords stored in here. I would find out if your cgi-bin is configured properly. Which it appears not to be.


#!/usr/bin/perl

require "subparseform.lib";
&Parse_Form;

$Email = $formdata{'Email'};
$FirstName = $formdata{'FirstName'};
$Company = $formdata{'Company'};
$ToComments = $formdata{'ToComments'};
$HearAbout = $formdata{'HearAbout'};

$ToEmail = "dee19802000\@yahoo.com";
$ToSubject = "Testing out Tutorial";

$EmailBody = "Sent By: $FirstName\nSenders Email: $Email\nSenders Company: $Company\n\n
Message Sent:\n$ToComments\n\nSender Heard About Site From: $HearAbout\n";

$EmailFooter = "\nThis message was sent by: $FirstName. If you feel that you
recieved this e-mail by accident please contact us at www.yourSite.com";

$Message = $EmailBody.$EmailFooter;

open (MAIL, "|/usr/sbin/sendmail -t") || &ErrorMessage;
print MAIL "To: $ToEmail \nFrom: $Email\n";
print MAIL "Subject: $ToSubject\n";
print MAIL "$Message\n";
close (MAIL);

print "Content-type: text/html\n\n";
print "_root.Mail.EmailStatus=Complete - Your mail has been sent";

sub ErrorMessage {
print "Content-type: text/html\n\n";
print "_root.Mail.EmailStatus=Connection Failed Please Check the path to the Mail program";
exit; }

dee19802000
11-04-2003, 06:41 AM
so how do i configure my cgi-bin? do it contact my server provider? I have been having nothing but problems with cgi/perl. If I post up my fla and cgi files could someone take a look and see if everything is in the right place?

DEE:confused:

freddycodes
11-04-2003, 06:45 AM
You'll need to contact your service provider.

Did you see before hand if your server even supports CGI?

I guarantee you that if your perl code is showing like it is, your server is not configured correcty.

myBad.script
07-08-2004, 02:39 PM
I've actually gotten this script to work - it needed a little rescripting. Do you still need the info? (This is an old post; I stumbled across it doing a search on a similar topic.)

CyanBlue
07-08-2004, 02:45 PM
Howdy... :)

It's always a good idea to show us how you have solved the problem so that other people can get some help from what you have learned... :)