PDA

View Full Version : help with a mailform question


Dougiemcn
09-15-2007, 06:56 PM
Hi, I have created a form with the intention of having the information e-mailed to myself. I have uploaded the cgi script to my providers cgi bin and when I check the url to the script, don't receive any apparent errors in my browser.

The problem is I don't receive the information from the form either.

I have attached the actionscript for the form text fields as well as the cgi script I have uploaded to the server and would be grateful if someone could have a look at both scripts to see if I am missing the obvious. There is of course far more to the cgi script but as far as I can see I only require the fields at the top of the script for the minimal amount of information I require. I can post the remainder if it helps.

This is my first attempt at using a cgi/perl script so any help would be appreciated, I've also replaced domain names and e-mail addresses but they are correct in the proper cgi script/flash file.

Cheers.

Dougie.

<-------------- script attached to send button below ------------------>

stop();

var gatherForm:LoadVars = new LoadVars();

//--------------------------------------------------------------------------------\\

function sendForm()
{
gatherForm.visitor_name = fullName.text;
gatherForm.visitor_address = fullAddress.text;
gatherForm.visitor_postcode = postcode.text;
gatherForm.visitor_telNumber = telNumber.text;
gatherForm.email_address = emailAddress.text;
gatherForm.sendAndLoad("http://www.mydomain.co.uk/cgi-bin/formmail/iopost.pl", "POST");

}

this.submitButton.onRelease = function()
{
if (fullName.text == "" || fullAddress.text == "" || postcode.text == "" || telNumber.text == "")
{
gotoAndStop("error");
}

else

{
sendForm();
gotoAndStop("correct");
}
}

--------------------<cgi script below>----------------------------------

#!/usr/bin/perl

# Define Variables #
# Detailed Information Found In README File. #

# $mailprog defines the location of your sendmail program on your unix #
# system. The flags -i and -t should be passed to sendmail in order to #
# have it ignore single dots on a line and to read message for recipients #

$mailprog = /usr/lib/sendmail -i -t';

# @referers allows forms to be located only on servers which are defined #
# in this field. This security fix from the last version which allowed #
# anyone on any server to use your FormMail script on their web site. #

@referers = ('www.mydomain.co.uk');

# @recipients defines the e-mail addresses or domain names that e-mail can #
# be sent to. This must be filled in correctly to prevent SPAM and allow #
# valid addresses to receive e-mail. Read the documentation to find out how #
# this variable works!!! It is EXTREMELY IMPORTANT. #
@recipients = ('myemail@me.co.uk');

# ACCESS CONTROL FIX: Peter D. Thompson Yezek #
# @valid_ENV allows the sysadmin to define what environment variables can #
# be reported via the env_report directive. This was implemented to fix #
# the problem reported at http://www.securityfocus.com/bid/1187 #

@valid_ENV = ('REMOTE_HOST','REMOTE_ADDR','REMOTE_USER','HTTP_U SER_AGENT');

# Done