how to get this thing to wrking.???

 
Post new topic   Reply to topic    Aprelium Forum Index -> FastCGI/CGI
View previous topic :: View next topic  
Author Message
izmon
Guest





PostPosted: Fri Dec 13, 2002 2:22 pm    Post subject: how to get this thing to wrking.??? Reply with quote

what do i wrong...
i have install perl and do all the things the instaler ask
i have put in the pad... /cgi-bin
i have did the index.pl
the cgi script works on server on the www
but in my own room it's not working that good
when i open the script it starts downloading
or it shows the content of the script.

i am new to this. so dont make fun of me 8O


#!/usr/local/bin/perl -w

# mail_form.cgi


$sendmail = '/usr/sbin/sendmail'; # where is sendmail?
$recipient = 'simon_wildvank@hotmail.com'; # who gets the form data?
$sender = 'Anonymous User <simon_wildvank@hotmail.com>'; # default sender?
$site_name = 'my site'; # name of site to return to afterwards
$site_url = 'rec.htm/'; # URL of site to return to afterwards

# script proper begins...

use CGI;
$query = new CGI;

# bundle up form submissions into a mail_body

$mail_body = '';

foreach $field (sort ($query->param)) {
foreach $value ($query->param($field)) {
$mail_body .= "$field: $value\n";
}
}

# set an appropriate From: address

if ($email = $query->param('07_email')) {
# the user supplied an email address
if ($name = $query->param('01_naam')) {
# the user supplied a name
$name =~ s/"//g; # lose any double-quotes in name
$sender = "\"$name\" <$email>";
} else {
# user did not supply a name
$sender = "$email";
}
}

# send the email message

open(MAIL, "|$sendmail -oi -t") or die "Can't open pipe to $sendmail: $!\n";
print MAIL "To: $recipient\n";
print MAIL "From: $sender\n";
print MAIL "Subject: aan melding infobulletin\n\n";
print MAIL "$mail_body";
close(MAIL) or die "Can't close pipe to $sendmail: $!\n";

# now show the thank-you screen

print "Content-type: text/html\n\n";
print <<"EOF";
<HTML>
<HEAD>
<TITLE>Bedankt</TITLE>
</HEAD>

<body bgcolor="#FFFFFF" text="#000000" background="Mainframe.jpg" bgproperties="FIXED"leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<div align="center">

<BODY>

<H1>Bedankt</H1>

<P>bedankt voor het aanmelden voor het infobulletin
.</P>

<P>Return to
<A HREF="rec.htm">$site_name</A>.</P>

</BODY>
</HTML>
EOF
Back to top
kent
Guest





PostPosted: Fri Dec 13, 2002 7:01 pm    Post subject: Reply with quote

first off you need to change this line

#!/usr/local/bin/perl

if your using windows
it may be like this to give you an idea

#!C:/perl/bin/perl.exe

you also need to change the path for 'sendmail'
if you even have it on your system
and make sure you change the redirect page to
what you want it to match with your website.
Back to top
Guest






PostPosted: Sat Dec 14, 2002 5:26 pm    Post subject: Reply with quote

CGI Interpreters
Interpreter Associated Extensions
C:\perl\bin\perl.exe pl


CGI Paths
Path
/cgi-bin <----------- i have this folder in C:\Program Files\Abyss Web Server\cgi-bin

User CGI Environment Variables
Name Value


all the thins are oke i think but still he is downloding thr file..:):)
Back to top
izmon
Guest





PostPosted: Sat Dec 14, 2002 5:57 pm    Post subject: 500 error Reply with quote

i have now a 500 error maby he cant fined my sendmail where can i get sendmail.?
Back to top
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Sun Dec 15, 2002 12:30 pm    Post subject: Re: 500 error Reply with quote

izmon wrote:
i have now a 500 error maby he cant fined my sendmail where can i get sendmail.?

Do a serach on "sendmail" in the forum. You'll find many topics discussing about how to get sendmail on windows. Do also a search on "blat".
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> FastCGI/CGI All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group