Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Still Cant Get Formmail.pl Form To Work, Trying Everything



This is the first brick wall ive hit when it comes down to making these websites. i get an internal server error when i try to submit a formmail. i have gone back to a clean slate and uploaded a new formmail.pl document. this is the one i am using. (http://www.scriptarchive.com formmail version 1.92). here is my script in my fla.

stop();

var gatherForm:LoadVars = new LoadVars();

function sendForm() {
gatherForm.email_to = "chris@blackbirdsound.com";
gatherForm.visitor_Message = form.Message.text;
gatherForm.visitor_Email = form.Email.text;
gatherForm.visitor_Name = form.Name.text;

gatherForm.send("/cgi-bin/formmail.pl", "_blank", "POST");
}

this.Submit.onRelease = function() {
if (form.Name.text == "" or form.Email.text == "" or form.Message.text == "") {
_root.gotoAndStop ("fail");
} else {
sendForm();
_root.gotoAndStop("success");
}
}



if anyone can help i will pay $20.00 for a working version. my IP address is 64.207.185.64, domain is blackbirdsound.com, and email is chris@blackbirdsound.com.

thanks chris.



FlashKit > Flash Help > Flash General Help
Posted on: 08-02-2005, 10:21 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Help With Formmail Cgi Email Form
Hello there, having big problems with a flashform I've done.
Downloaded a formmail.pl and mada some changes for the variables.

http://www.fullforce.tv

Actually my flashform has three variables: name, email and comments.

I know I have to place a load variables in the submit button, pointing to my cgi in the server http://www.fullforce.tv/cgi-bin/formmail.pl

...but I don't get anything(!)

The following is a part of the formmail I have on the server in order to set the variables, is there anything lacking?

Thanks, Piero

#!/usr/bin/perl
################################################## ############################
# FormMail Version 1.6 #
# Copyright 1995-1997 Matt Wright mattw@worldwidemart.com #
# Created 06/09/95 Last Modified 05/02/97 #
# Matt's Script Archive, Inc.: http://www.worldwidemart.com/scripts/ #
################################################## ############################
# COPYRIGHT NOTICE #
# Copyright 1995-1997 Matthew M. Wright All Rights Reserved. #
# #
# FormMail may be used and modified free of charge by anyone so long as this #
# copyright notice and the comments above remain intact. By using this #
# code you agree to indemnify Matthew M. Wright from any liability that #
# might arise from its use. #
# #
# Selling the code for this program without prior written consent is #
# expressly forbidden. In other words, please ask first before you try and #
# make money off of my program. #
# #
# Obtain permission before redistributing this software over the Internet or #
# in any other medium.In all cases copyright and header must remain intact #
################################################## ############################
# Define Variables #
# Detailed Information Found In README File. #

# $mailprog defines the location of your sendmail program on your unix #
# system. #

$mailprog = '/usr/lib/sendmail';

# @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 = ('fullforce.tv','youripaddress');

# Done #
################################################## ############################

FormMail W/ A Flash Form
What is the correct way to send a variable from a drop down menu, check box, and radio button to FormMail? I'm recieving all of the info in my text fields without a problem. Here's what I have so far. Thanks a lot for your help...



firstname = "";
lastname = "";
company = "";
title = "";
address = "";
city = "";
state = "";
zipcode = "";
country = "";
phone = "";
fax = "";
email = "";
month = month.getSelectedIndex();
day = day.getSelectedIndex();
year = year.getSelectedIndex();
eventtype = eventtype.getEnabled();
othereventexplain = "";
location = "";
attendance = "";
duration = "";
appetizers = appetizers.getEnabled();
breakfast = breakfast.getEnabled();
lunch = lunch.getEnabled();
dinner = dinner.getEnabled();
dessert = dessert.getEnabled();
othermeal = othermeal.getEnabled();
othermealexplain = "";
theme = theme.getEnabled();
themeexplain = "";
diet = diet.getEnabled();
dietexplain = "";
alcohol = alcohol.getEnabled();
alcoholexplain = "";
heardabout = "";
hear_email = hear_email.getEnabled();
hear_phone = hear_phone.getEnabled();
hear_fax = hear_fax.getEnabled();
hear_postal = hear_postal.getEnabled();
comments = "";

Creating A Contact Form With Formmail.asp
I created a contact form on my flash web site. I need to add action script to my sumit button. I have used several POST scripts to call my handler, but no luck. I am using "formmail.asp" from http://www.brainjar.com which is the required handler by my server. Can any one help with the submit action script to call this handler.

thanks

Formmail.pl Not Taking My Form DataarggggH
i'm just trying to send some form data from a flash 5 movie to frommail.pl on my server,,,,the message is not allowing me to send parameters directly to the script!!! WTF why not...isn't that all i'm supposed to do,,,...please i'm veryvery frustrated,,i worked 6 hours on this 'wonderful' little problem lastnight and everything i'v found says what i'm doing should work fine.....which is(::
on (release){
getURL ("http://64.225.70.163/cgibin/formmail.pl", "", "POST");
}

WHY isn't this working,,,please someone can make this work.......
at wits end am i
and i don't want to be thinking about this tomorrow in line for starwars....so please...all help is greatly appriciated.
shane.

Is There A Script For Flash Form To Use Formmail?
Yes, i once used a script named formmail to send out my flash forms. Can anyone help me find the script and tutorial for the setting up of the flash form. I have lost the booking of it. Thanks

Form Problem - FormMail (.fla Included)
Can someone please check out my .fla and let me know what I'm doing wrong? My form is not sending me e-mail...
Thank you

http://www.hellskitchenchicago.com/t...act_submit.zip
http://www.hellskitchenchicago.com/t...act_submit.swf

Flash Form And FormMail Script
Hi

I am fairly new to using Flash. Is it possible to create a form in Flash 8 and use the CGI Script FormMail to post the contents?

Thanks.

Making A Form In Flash 4 Using Formmail.pl
HELLO!  Here is what I have.

1.  I downloaded Matt's formmail.pl and got it set up
     based on his README file

2.  I can call formmail.pl in a html based form and
    receive the information (via email)

3.  When I put it in flash I can get Matt's autoresponse
    that I have used the script but no information

Quesion:  Am I looking at a config issue with the script?
            or
          Am I looking at an issue with earthlink's   
          (hosting) 'sendmail'?

HELP.....PLEASEEEE


Getting A Flash To Work With FormMail
Ok, I have tried a couple things. First of all, I have my form fields dumping into a LoadVars object called form.

form = new LoadVars();
form.blah1 = "blah";
etc etc

Now, when I try doing:

form.sendAndLoad("url/cgi-bin/formmail.pl", replyData, "POST");

I get nothing. Putting this inside an on(release) action on my submit button does nothing. I even tried it from the SWF on the same server as the formmail since the Flash docs say that they have to be on the same domain for security. But nothing happens when I press the button.

I've been able to get it to work when using send(). But then it pops up the browser window with the result and I want to suppress that into the replyData variable. But when I do sendAndLoad(), it doesn't send to the script.

Problems Using UI Form Components In MX2004 Sending To Formmail.pl
Hi guys,

I've got a site that is using a basic set of UI Components that are referencing a formmail.pl script.

It 'seems' to be working, as in as much that I recieve the email but the contents aren't what I expected.

The email contains the following:
tfList: [object Object]
stylecache: [object Object]
useHandCursor: false
rolloverIcon: falseUpIcon
childrenCreated: true
__f_click: [type Function]
initializing: false
upSkin: _level0.instance46.fus
skinName: _level0.instance46.frs
phase: rollover
rolloverSkin: _level0.instance46.frs
downSkin: _level0.instance46.fds
keyHandler: [object Object]

Can anyone point me in the direction of a decent tutorial?

cheers
--Neil

Flash Formmail Forms Work Remotely...but Not On The Server?
Hey guys...

Have a very odd problem.
I have flash forms that call a formmail script that work fine while testing my movie and just opening the .swf off my hard drive...it accesses the script and sends me the email.

But when I upload the .swf to the server and view them live, they do not send me the email. The files are identical, same path and recipient, so I have no idea why they work remotely but not on the server.

My hosting service has not idea?
Anyone have a suggestion...any help would be much appreciated.

thanks
tony

How Do I Get My Form To Work
I have put together a contact form. I have placed all of the input text fields and in the variable placed name,address, email, etc... I have created the submit button. Now how do I get it to work. What is the scripting I need and where does it need to go? Thanks to anyone who can help! I'm very new to flash5 and feel a bit frustrated and overwhelmed!

Cant Get Form To Work Please Help
Hi I have been having trouble for ages to get my form to work now, and i just cant do it. So i am asking you pros out there for some help please.

I also wanted to add some extra fields, but am not sure on how to add checkboxes and since i cant get what i have allready made to work, thought i should stay clear of it for a while.

The .pl and the .fla are available at

http://www.visual-designs.co.uk/problems/form.pl

http://www.visual-designs.co.uk/problems/enquiry.fla

When i fill in the form it says it has sent the data but i never recieve it! My webhost supports all scripting and the perl settings are right according to my host.

Aghh,,, please please help me as im dead stuck

many thanks

alexasigno@hotmail.com

Form Won't Work?HELP HELP HELP
Hi.

Trying to get a form to work using a tutorial we found on flashkit. I have zipped the flash file and the FormMail.pl file we are using on my server.

Wondering if someone can check them over for mistakes, as we dont recieve e-mail after filling in the form.

The path to perl is correct for my server
so is the sendmail path.

What could be wrong?
I would appreciate your help.

Thank you
Rich

web address it is uploaded to: www.platinumjar.co.uk/form.swf

I Need To Have This Form Work Please Help
hello, i have modified the code at the top of the php file that says: "enter your site details below". please help me. this code for the orginial file doesn't do what it should either.

heres my code

frame 1 action

fscommand("allowscale", "false");
//
// set some variables
//
mailform = "mailform.php";
confirm = "please wait for confirmation ...";
action = "send";
//
// and focus on variable fname
//
Selection.setFocus("fname");
//
// validate email function
//
function validate(address) {
if (address.length>=7) {
if (address.indexOf("@")>0) {
if ((address.indexOf("@")+2)<address.lastIndexOf(".") ) {
if (address.lastIndexOf(".")<(address.length-2)) {
return (true);
}
}
}
}
return (false);
}
//
// form check
//
function formcheck() {
if ((((email == null)) || (email.length<1)) || (email == "ERROR! Address not valid")) {
email = "ERROR! Address not valid";
action = "";
}
if (!validate(email)) {
email = "ERROR! Address not valid";
action = "";
}
if (fname == null) {
fname = "ERROR! Name required";
action = "";
}
if (lname == null) {
lname = "ERROR! Name required";
action = "";
}
if ((validate(email)) && (email != "ERROR!") && (fname != "") && (lname != "")) {
action = "send";
loadVariablesNum(mailform, 0, "POST");
gotoAndPlay("wait");
}
}
stop();

Can Someone Help Me Get My Form To Work?
Hello and thanks for your time.

I have a form but do not know how to make it work? can someone perhaps take a look at my .fla and help me to make it work.

Cheers
Craig

http://www.spikeydog.net/public/feedback form.fla

Why Does'nt My Form Work?
Hi All!

I needed to know why does my flash form not work?
I have used one of the tutorials on kirupa, but it seems like I dont recieve any mails after the submission...

Here is the PHP code :
PHP Code:



<?$destination="sam.chikku@gmail.com";$name=$_POST['name1'];$email=$_POST['company'];$mes=$_POST['email'];$mes=$_POST['number'];$mes=$_POST['message1'];$subject="Message from $name" ;$mes="Name : $name
Email: $email
Comments: $mes
";mail($destination,$subject,$mes); ?>




and here is the actionscript on the submit button:

Quote:




on (release) {
if (_root.pgap.pages1.page5.name1 == "Name" ||
_root.pgap.pages1.page5.company == "Company" ||
_root.pgap.pages1.page5.email == "E-mail" ||
_root.pgap.pages1.page5.number == "Phone" ||
_root.pgap.pages1.page5.message1 == "Message" ||
_root.pgap.pages1.page5.name1 == "" ||
_root.pgap.pages1.page5.company == "" ||
_root.pgap.pages1.page5.email == "" ||
_root.pgap.pages1.page5.number == "" ||
_root.pgap.pages1.page5.message1 == "") {
_parent.gotoAndStop(3);
} else {
_parent.loadVariables("email.php", "POST");
_parent.gotoAndStop(2);
}
}




Kindly let me know if there is any problem with this..

Thanks all
Chikku

Pls Help With My Form. It Wont Work
I hope someone can please help me. I have been trying to figure this problem out for 2 weeks now and getting NOWHERE! My feedback form on my new website will NOT work at all! I mean, it will not email me the results. I dont know what I am doing wrong! My current html website that is up uses the exact same formmail script that I have on my server and my results are sent to me fine, so im thinking it must have something to do with the flash. Here is the scripting that I have attached to my submit button.
on (release) {
subject = "Contact Form";
recipient = "sales@wdu.net";
loadVariablesNum ("http://www.wdu.net/cgi-local/FormMail.pl", 0, "GET");
gotoAndPlay ("Thank you");
}

I know that the url is correct and I know that all the variables in my formmail are correct because the other site is using it just fine. I have also tried to replace the GET with POST and it wont work either. Can anyone give me some feeddback or troubleshooting ideas that I can try? Thanks to anyone who can help! I REALLY need to get this done soon and this is the only thing holding it up.

**Ok, ive tried Netbreed's flashmailer that I heard some people talking about on the S&B forum, but it STILL wont work. I am totally clueless now because I have never had this much problems in HTML.
[Edited by wdu2000 on 06-24-2001 at 06:26 PM]

Trying To Get My FLASH Form To Work
i created a form from a flashkit tutorial found here: http://www.flashkit.com/tutorials/Dy...15/index.shtml

and im having trouble getting the submission to work. i dont receive anything when i fill out the form. could it be a server-side thing? and if so, is there anyone that could help me, im totally new to this thing!

My Feedback-form Does'nt Work
AAAAHHHH, most probably I'm just blind, but can you help me please?

I try to make a feedback-form in MX, everything works BUT:

I get the message via email from my perl ('nether-mail' and I've tried 'FormMail', too) WHEN I'M PREVIEWING THE FILE (ctrl + F12)

But when I put the .swf onto my Server and try the form - I don't get the feedback-email !

Can anyone imagine what could be the mistake I made and what I have to do?

THX in advance
auric

How To Make This Form Work?
Can anyone help me make this form work? I need a form that looks and acts like this, which I can capture the variables and send them to PHP. I also want it to TAB thru accordingly.

Checkbox To Work With Asp Form
Hi. I have a form in flash that is working... simple name, email, comments and when you hit submit it sends me an email using an asp file. It works fine, but now I want to add a checkbox. The checkbox lOOKS like its working but I don't know how to code the asp file to let me know if the user checked it off or did not check it off. The checkbox is a movie clip. PLEASE HELP. You can see the form at http://www.dangerousmedia.com/dmflash.html on the contact page.

THANKS

Jeanine

I Can't Get My Submit Form To Work..help Please?
Hi,

I was wondering if someone could help me to get my submit form on my website to work? I am working in Flash 5 and I used this tutorial on flashkit to create my form:

http://www.flashkit.com/tutorials/In...-807/index.php

The two problems that I have:

1) I cannot get the information contained in the submit form to be sent to the email address that is specified in the script. (I have tried both suggestions by Matthew in his tutorial by switching 'mailuser' to 'targetpage' and 'recipient' to 'redirect'. Neither of which seem to solve this situation.

2) I did not get the part in Matthews tutorial about setting up the script so that the 'thanks, your information has been submitted' message would open within the same flash movie. I know that right now it is setup to load into a 'thanks.htm' file. How do I get it so that it does NOT open an external window with a thanks message and the movie just will go to a different frame to tell the user thanks. Is that possible? If it is not possible and I have to have a thanks.html open then I need some help getting that to work. I created a thanks.html page and uploaded it to my server. I put the page in both my cgi folder and my html folder but the page wont come up when directed.

I have attached my .fla file. Can someone please help me with this?

thanks in advance...

Form Doesn't Work
ignore this
just sorted it out

Getting A Flash Form To Work
what is the best way to make a flash form transmit info to an email address?

Can't Get Form In Flash To Work PHP
Hello,
I'm having a very difficult time getting a form in Flash to work. I want to use a php script. I know that my server supports it because I'm able to send myself an email using a php script located on the server.

Basically what I want is just a single input field form for people to enter their email address. It would then be sent to my email address in a message, so I could add it to my records and e-list.

I've found tutorials all over the web about email forms, and I've tried to modify them to get them to work like I want. It seems to me the problem is that the script isn't receiving the variables from flash.
As I mentioned above, the php email is working fine as I've tested it independently.

What could be going wrong that I need to fix? I've followed several tutorials and none have worked for me yet.

Any and all help is immensely appreciated!
-Daniel
------------
Version: Flash MX 2004

Why This Form Field Does Not Work
i set up text feld set it to dynamic

then attached the scroll bar

and still i can not see the scroll bar just the whitefield where the scroll should be

can someone tell me what i am doing ewrong

Sumit Form To Work ?
hello guys, I have a template and it has a contact page all setted up and it has a form in it to fill up etc... how do i get that to work and send emails to my email account ?
thanks.

Flash Form Won't Work In IE...?
I have created a small search text box in flash for searching the website (it searches and outputs to HTML, not flash).

I also have the AC_RunActiveContent.js thing installed, so that's not the issue. The flash file itself loads fine. However, whenever I submit a search term in the box, it comes back saying that "your referrer does not match our list of trusted hosts." It works just fine in Firefox. Here is the code that I have in the flash file for the search box:

on (release, keyPress "<Enter>") {
var my_lv:LoadVars = new LoadVars();
my_lv.searchTerm = searchTerm.text;
my_lv.send("search.asp", "_self", "GET");
}

What can I do to fix it?

Flash Form Won't Work In IE...
I have created a small search text box in flash for searching the website (it searches and outputs to HTML, not flash).

I also have the AC_RunActiveContent.js thing installed, so that's not the issue. The flash file itself loads fine. However, whenever I submit a search term in the box, it comes back saying that "your referrer does not match our list of trusted hosts." It works just fine in Firefox. Here is the code that I have in the flash file for the search box:

on (release, keyPress "<Enter>") {
var my_lv:LoadVars = new LoadVars();
my_lv.searchTerm = searchTerm.text;
my_lv.send("search.asp", "_self", "GET");
}

What can I do to fix it?

HELP Cant Get My Flash Form & PHP To Work
Hello all...

I can't get my online form to work correctly. I've read severval tutorials, but I just cant seem to pull it off.

Could someone be kind enough to help me out with this problem?

To view the site go to: http://www.kosmodesign.com/af.htm

(under the online form section)

If you can help me out, let me know and I can email you the .fla file.

Many thanks,

KJ

I Can't Get Php And Swf Contact Form To Work
Hi all,

I am trying to complete my first HTML site but am having some trouble getting a contact form i downloaded at http://www.macromediahelp.com/flash/..._contact_form/ to work.

My page link is:

http://www.yusufm.com/contact.html

I put both the mailer php and contact form in a subfolder and replaced 'email@yourserver.com' with my email address.

Is there anything I may have overlooked?

Any help would be greatly appreciated

E-mail Form Won't Work
Hello,

Sorry I've already posted the same question but at MX thread. I'm actually using Flash 8 professional, I'm not sure if it makes difference. Problem is exactly the same as follow:

http://www.actionscript.org/forums/s...666#post601666

I loaded e-mail form swf file into a main swf. E-mail function works but it won't go to the next frame. I understand the mail form swf is no longer _root because it's loaded into a main swf file. I tried this. and also this + instance name with it but the result are the same. I have no idea what is wrong... help!!

Pls Help~ My Form Mail Cannot Work?
My friend wrote me an asp script for a form mail.. but the mail can't be delivered to the mailbox... is there any error for the fla or asp? i uploaded the files here:

http://www.super-tomato.com/ita/contact.zip

Plsss help~~ thx

Looking For A Way To Make A Form WORK
I have made a website for my company using Flash and someone has requested that I add a form to our website. Right now the user clicks the link and it opens his/her default email (Simple!), but now they want them to click that button and have the user goto another page where they enter their name, email, phone, company name, have a combo box listing what department the email will be going to, then a comments box. I have tried and tried to get this to work. I created a simple form with my name, phone, and comments box, filled it out and hit the send button. I never recieved the email with the information. My work uses an exchange server for the mail. I have tried an asp and a php behind to go behind this form and I have no luck so far. I think between our exchange server, our email filter, and firewall, somewhere along the line it gets blocked out or something. I did check the email filter and it was not getting caught in that. In conlclusion I didn't know if anybody might know how I can get information from a form sent to me in an email or if I can get the online form to write a file and save it to a location on the webserver. If you could help I would really appreciate it.

GET FLASH FORM TO WORK
OK, I am trying to get my flash form to work and I'm working with a template from FLASH MX BIBLE. I'm going to paste both my action script and my cgi script in here & hopefully I can find an answer to why it doesn't work. Basically what happens is it says it was received, but it wasn't. ... or it is but none of the words come through (this happened earlier before I tried tweeking the script... which I think made it worse).


........ thank you thank you to anyone who can help me ...........










Attach Code

HERE is the ACTION Script for Flash:
userComments = new LoadVars();
userComments.onLoad = function(success) {
if (success) {
_root.gotoAndStop("output");
} else {
_root.gotoAndStop("error");
}
};
function sendComments() {
var obj = userComments;
obj.fromEmail = fromEmail.text;
obj.fromName = fromName.text;
obj.toEmail = "chicfurniture@sbcglobal.net<mailto:chicfurniture@sbcglobal.net>";
obj.toName = "Shawna Cogar";
obj.subject = "C2C Feedback";
obj.body = comments.text;
userComments.sendAndLoad("http://chictochicfurniture.com/cgi-bin/sendmail.cgi", userComments, "GET");
_root.gotoAndStop("wait");
}

AND here is the CGI script that I copied directly from the CD
#!/usr/bin/perl

use CGI;

# ----------------------------- define variables -----------------------------

# @restrictTo is an array containing refering addresses to which you
# wish to grant access to your script. If it contains a single value of
# 'all' then any refering address can access your script.

# uncomment the next line to grant access to only restricted addresses
#@restrictTo = ('chictochicfurniture.net');

# comment the next line if you restrict access.
@restrictTo = ('all');

# $toEmail is the default email you wish this script to send all
# emails to. uncomment the line below to do this.
# $toEmail = 'chicfurniture@sbcglobal.net<mailto:chicfurniture@sbcglobal.net>';

# $sendMailProg is the location of the mail send program on your server.
# the default setting will work for most Unix servers.

$sendMailProg = '/usr/lib/sendmail';

# ------------------------ end define variables ----------------------------------

# -------------------------- call subroutines ------------------------------------

# step 1: validate the refering address
&validateReferer;

#step 2: get data from form post
&getData;

#step 3: check the output request type
&checkOutputRequest;

#step 4: check required fields
&checkRequired;

#step 5: send email
&sendEmail;

# ----------------------- end call subroutines -----------------------------------

# --------------------------- subroutines ----------------------------------------

sub validateReferer
{
local $isValid = 0;

# checks to make sure that the HTTP_REFERER has been passed
if ($ENV{'HTTP_REFERER'})
{
# compares each address in the @restrictTo array to the refering address
# if it finds a match, it flags $isValid to true and breaks out of the
# foreach loop
foreach $address (@restrictTo)
{
if ($ENV{'HTTP_REFERER'} =~ m|https?://([^/]*)$address|i || $address eq 'all')
{
$isValid = 1;
last;
}
}
}
# if HTTP_REFERER has not been passed, it checks to see if the value of the first
# element of the restrictTo array is 'all', in which case all refering addresses
# are granted access, so the $isValid is flagged true.
elsif ($restrictTo[0] eq 'all')
{
$isValid = 1;
}

# if the refering address is not a valid on, output an error message.
if ($isValid != 1)
{
&output('invalidAddress');
}
}

sub getData
{
if ($ENV{'REQUEST_METHOD'} eq 'GET')
{
# split the query_string into an array that holds the name/value pairs.
@variables = split(/&/, $ENV{'QUERY_STRING'});
}
elsif ($ENV{'REQUEST_METHOD'} eq 'POST')
{
read(STDIN, $fromPost, $ENV{'CONTENT_LENGTH'});

# split the previously assigned value of $fromPost into an array that
# holds the name/value pairs.
@variables = split(/&/, $fromPost);
}

# if no request method has been passed (no form information) then output
# an error message.
else
{
&error('noRequestMethod');
}

# break each name/value pair apart, convert them from the URLenceded format,
# and place them into an associative array.
$k = 0;
foreach $variable (@variables)
{

local($varName, $varValue) = split(/=/, $variable);

$varName =~ tr/+/ /;
$varName =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;

$varValue =~ tr/+/ /;
$varValue =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;

$varValue =~ s/<!--(.|
)*-->//g;

$FIELDS{$varName} = $varValue;

$order[$k] = $varName;
$k = $k + 1;
}

}

sub checkOutputRequest
{
$outputEnvVars = 0;
if (defined($FIELDS{'envVars'}))
{
if ($FIELDS{'envVars'} eq 'yes')
{
$outputEnvVars = 1;
}
if ($FIELDS{'envVars'} eq 'only')
{
&output('envVars');
}
}
}

sub checkRequired
{
# checks to see if a formfield called 'required' has been passed
# if not, define @required to be empty. otherwise, define @required
# to be the elements from the comma-delimited list passed from the form.
if (!defined($FIELDS{'required'}))
{
@required = ();
}
else
{
@required = split(/,/,$FIELDS{'required'});
}

# in order to send an email it is necessary to have an address to
# which to send. if no value was passed and a default has not been
# specified within the script, then add to the array of missing
# values.
if (!defined($FIELDS{'to'}))
{
if (!defined($toEmail))
{
push(@missing, 'to');
}
}
# if an email address has been passed frmo the form, then make sure that it
# is a valid format for an email address. otherwise, output an error message.
elsif ($FIELDS{'to'} =~ /(@.*@)|(..)|(@.)|(.@)|(^.)/ || $FIELDS{'to'} !~ /^.+@([?)[a-zA-Z0-9-.]+.([a-zA-Z]{2,3}|[0-9]{1,3})(]?)$/)
{
&output('badEmail');
}

# check to make sure each required formfield has been passed.
foreach $require (@required)
{
if (!defined($FIELDS{$require}))
{
push(@missing, $require);
}
}

# if any missing formfields were detected, output the error message.
if (defined(@missing))
{
&output('missingRequired');
}
}

sub sendEmail
{

# begin sending the mail.
open(MAILPROG, "|$sendMailProg -t");
if (defined($FIELDS{'to'}))
{
print MAILPROG "To: $FIELDS{'to'}
";
}
elsif (defined($toEmail))
{
print MAILPROG "To: $toEmail
";
}
else
{
&output('badEmail');
}

if (defined($FIELDS{'from'}))
{
print MAILPROG "From: $FIELDS{'from'}
";
}
else
{
print MAILPROG "From: <unknown>
";
}

if (defined($FIELDS{'subject'}))
{
print MAILPROG "Subject: $FIELDS{'subject'}

";
}
else
{
print MAILPROG "Subject: <none>

";
}

# print each variable name and value to the body of the email.
foreach $index (@order)
#foreach $member (keys %FIELDS)
{
if ($index ne 'to' && $index ne 'from' && $index ne 'subject')
# if ($member ne 'to' && $member ne 'from' && $member ne 'subject')
{
print MAILPROG "$index:

$FIELDS{$index}

";
# print MAILPROG "$member:

$FIELDS{$member}

";
}
}

# sends email.
print MAILPROG ".";

close (MAILPROG);



# output the success of the send to the user.
&output('sentEmail');

}


sub output
{
# create a local variable to hold the value of the paramaters
# passed to the subroutine.
local ($outputType) = @_;

if ($outputType eq 'invalidAddress')
{
print "Content-type: text/plain

";
print "success=0&error=invalidAddress";
exit;
}

elsif ($outputType eq 'noRequestMethod')
{
print "Content-type: text/plain

";
print "success=0&error=noRequestMethod";
exit;
}

elsif ($outputType eq 'missingRequired')
{
# create local variable to hold length of array for
# missing formfields.
local $howManyMissing = scalar(@missing);
print "Content-type: text/plain

";
print "success=0&error=missingRequired&missing=";

# print a comma-delimited list of the missing formfields.
for ($i=0; $i< $howManyMissing-1; $i++)
{
print "$missing[$i],";
}
print "$missing[$howManyMissing-1]";
exit;
}

elsif ($outputType eq 'badEmail')
{
print "Content-type: text/plain

";
print "success=0&error=badEmail";
exit;
}

elsif ($outputType eq 'envVars')
{
print "Content-type: text/plain

";
print &envVars;
print "&timeDate=";
print &makeDate;
exit;
}

elsif ($outputType eq 'sentEmail')
{
print "Content-type: text/plain

";
print "success=1&timeDate=";
print &makeDate;
exit;
}
}

sub makeDate {

@days = ('Sunday','Monday','Tuesday','Wednesday',
'Thursday','Friday','Saturday');
@months = ('January','February','March','April','May','June','July',
'August','September','October','November','December');

($sec,$min,$hour,$dayOfMonth,$month,$year,$dayOfWeek) = (localtime(time))[0,1,2,3,4,5,6];
$time = sprintf("%02d:%02d:%02d",$hour,$min,$sec);
$year += 1900;

$date = "$days[$dayOfWeek] $dayOfMonth $months[$month] $year $time";
$date = CGI::escape($date);

return $date;
}


sub envVars
{
local $remoteHost = $ENV{'REMOTE_HOST'};
local $httpReferer = $ENV{'HTTP_REFERER'};
local $httpUserAgent = $ENV{'HTTP_USER_AGENT'};

$remoteHost = CGI::escape($remoteHost);
$httpReferer = CGI::escape($httpReferer);
$httpUserAgent = CGI::escape($httpUserAgent);

$envVars = "REMOTE_HOST=$remoteHost&HTTP_REFERER=$httpReferer&HTTP_USER_AGENT=$httpUserAgent";
return $envVars;
}
# ----------------------------- end subroutines ------------------------------------

























Edited: 09/29/2007 at 02:29:07 PM by photogirl_78

Grr. Cannot Get PHP Contact Form To Work.
Hi!

I cannot get a PHP contact form working. I have tried everything i can think of (which isn't much!) and can't get it to work. This is what i am using. Can anybody see what's wrong with this please? As you can see, the form contains a fromname, fromemail, subject and message fields.
I'm a complete newb when it comes to PHP. Please please please help.









Attach Code

ActionScript on form frame:
function lineAdapt() {
message_send = message;
while (msg_count<length(message)) {
msg_count = msg_count+1;
if ((substring(message_send, msg_count, 2)) eq "
") {
message_send = (substring(message_send, 1, msg_count-2)) + "
" + (substring(message_send, msg_count+2, (length(message_send))-msg_count+2));
}
}
message = message_send;
delete msg_count;
delete message_send;
}

Action script on button:
on (release) {
if (subject eq "" or message eq "" or fromname eq "" or fromemail eq "") {
stop();
} else {
lineAdapt();
loadVariablesNum("mail.php3", 0, "POST");
gotoAndStop(415);
}
}

PHP script:
<?php
mail("my@emailaddress.com", $subject, $message, "From: $fromname
Reply-To: $fromemail
X-Mailer: PHP/" . phpversion());
?>

Contact Form Won't Work
well i've tried everything i can think of to get this email form to work. I followed the email form in flash using PHP tutorial and the only thing i can think of as being the cause of the problem is that the contact form is within a movie clip and not on the main timeline. do i need to put a _root. somewhere infront of the send button code to make this work? if so where?

whenever i test the form on my server it just seems to get stuck and never even move on to the thank you frame.

at the moment i ahve this script on the send button


Code:
on (release) {
form.loadVariables("email.php", "POST");
}
and this on the form movieclip

Code:
onClipEvent(data){
_parent.nextFrame();
}

thank you in advance.

Getting Form Components To Work
could use some creative input, criticism, advice, ideas, etc.

pretty much finished, oh and i want to make the contact form work, not sure how

thanks!

http://tomsriverpizza.com/nufloor/galleries.html

Getting Flash Form To Work...
Hi every one I'm in the process of building a flash form I've been following tutorial:

http://www.kirupa.com/developer/actionscript/flash_php_email.htm

MY EXAMPLE WORK FILE: http://www.johncliffordtaylor.com/form_help.fla

But I've made a change to the work layout (details below) and now I can't get my:

onClipEvent(data){
_root.nextFrame();
}

ActionScript to work so when you press the send button on the form page the play head doesn’t advance to the thank you frame.

In the tutorial shown all the frames are on the main timeline. Because of existing content layout in the site I’m building this form for I have to build the same form and placed it in a movie clip aptly named "form" so it will occupy only one frame on the main timeline.

Sadly this is where the problems start because even though the PHP email function is working fine, the when you click on the send button the play head doesn’t advance to the thank you frame.

I think the problem lines in the:

_root.nextFrame();

Part should it be a:

this.nextFrame();

So any help would be very cool thx for taking the time to read and help out

John

Contact Form Won't Work
well i've tried everything i can think of to get this email form to work. I followed the email form in flash using PHP tutorial and the only thing i can think of as being the cause of the problem is that the contact form is within a movie clip and not on the main timeline. do i need to put a _root. somewhere infront of the send button code to make this work? if so where?

whenever i test the form on my server it just seems to get stuck and never even move on to the thank you frame.

at the moment i ahve this script on the send button


Code:
on (release) {
form.loadVariables("email.php", "POST");
}
and this on the form movieclip

Code:
onClipEvent(data){
_parent.nextFrame();
}

thank you in advance.

Please Help. My Mail Form Does't Work.
I need to get a cgi script to make work my flash form mail.
I don't know where to get it.
My form mail is in this address:
www.fasshannon.ie/webdesign/gmorales

Form Problems - They Used To Work
Hi There,

I've been having issues with forms in Flash lately. Bacially forms that I created previously are no longer working.

here is an example of submission code I used:
loadVariablesNum('http://www.obskure.org/wavin/form.asp?srName='+_root.mainMovie.srName.text+'&srCompanyName='+_root.mainMovie.srCompanyName.text+'&sr CompanyType='+_root.mainMovie.srCompanyType+'&srNumber='+_root.mainMovie.srNumber.text+'&srAltNumber='+_root.mainMovie.srAltNumber.text+'&srEmail='+_r oot.mainMovie.srEmail.text+'&srBrochureRequest='+_root.mainMovie.srBrochureRequest+'&srCallMe='+_root.mainMovie.srCallMe+'&srQuery='+_root.mainMovie.q ueryEscaped, 99, "POST");

Any help will be very much appreciated.

HELP...My Form Doesn't Work Online....
Hi guys:

I have a little dilemma....! I have built a form in flash that uses an ASP file to send the form results to an email. Now, it works perfectly locally but once I post it online, I get nothing, no results, no email. Does anyone know what the problem could be? I worked sooooooooo hard on the form and I would be utterly indebted to anyone out there who can help me!

Thanks a bunch, I owe you in advance.

HELP My PHP Mail Form Doesn't Work...
i have a problem... i want to create an email form in Flash MX. I've downloaded a FLA from FlashKit, but when i want to test the form, it doesn't work...

I think is because he can't connect with a mail server.

The test URL is:
http://www.surfdude.org/test/form/contact2.html

How can I let it work?!?!!?

greetz...

Flash Form Work With Php File
Hello,

i am trying to make a flash form working with a php file that sends the input data into my email.
the text boxes are working but i cant make the radio buttons and check boxes to work.
is there some one that can tell me what should i do.
i have attached the files so you understand better what im trying to do.

thanks once again!

Why Doesnt My Mail Form Work? Please Help
ok so i have the a place for the user to enter there name , email , and a message then there is the submit buton i have all the coding done . i have a PHP file with this in it" <?
$ToEmail = "Karim@VisualKreations.com";

$ToSubject = "Contact Form";

$EmailBody = "Sent By: $FirstName
Senders Email: $Email

Message Sent:
$ToComments
";

mail($ToName." <".$ToEmail.">",$ToSubject, $EmailBody, "From: ".$FirstName." <".$Email.">");

?> "


but when i try it i never get the email.

any idea what im doing wrong?

How Do You Make The Contact Form Work?
Hi,

I have a contact page on my website that is not functioning. It has a place for the user to put their name, email address, and message. Then they should be able to hit the submit button and it be sent to my email address.

Does anyone know how to set this up? Please be specific, I'm still fairly new.

Thanks,
Jeremy

Copyright © 2005-08 www.BigResource.com, All rights reserved