View Full Version : This is CGI speaking ...

07-04-2001, 07:56 AM

Here is the script in my mail.cgi file (located in my cgi-bin directory on the server):

%%%%%%%%%%%%%%%%%%%%%SCRIPT STARTS HERE%%%%%%%%%%%%%%%%%%%%

use CGI;
$query = new CGI;
for ($query->param) { $in{$_} = $query->param($_); }

unless(open(MAIL,"|/usr/lib/sendmail -t")) {
print "Content-type: text/html\n\n";
print "Unable to open sendmail binary.";
print MAIL "To: $in{mail_to}\n";
print MAIL "Subject: $in{mail_subject}\n";
print MAIL "From: $in{mail_from}\n\n";
print MAIL $in{mail_message};

print "Location: http://www.studiorapid.com\n\n";
%%%%%%%%%%%%%%%%%%%%%SCRIPT ENDS HERE%%%%%%%%%%%%%%%%%%%%%%

This works fine for 3 input fields:
1- mail_subject
2- mail_from
3- mail_message
(note : the "mail_to" variable is set by the Flash movie)

I added a fourth input field to my Flash movie. Therefore I tried adding this line to the cgi script ...

print MAIL $in{mail_name};

... after the "print MAIL $in{mail_message};" line

It still didn't work.

Is anyone familiar with cgi that knows what I'm doing wrong. I suspect that it is a really simple error for someone who knows cgi. Maybe something to do with "$in" in my newly added line.