Skip to main content
April 11, 2007
Question

Earthlink CGI script and Flash

  • April 11, 2007
  • 95 replies
  • 24213 views
I've created a contact form in Flash and the script can't find the URL at Earthlink. I've talked to EL and they said use the EL CGI html code and incorporate in the Flash script. I tried a multitude of ways and get constant syntax errors. My code has no errors but can't find the URL. I've attached my code and Earthlink's sample code. Can someone show me where to put what?
Thanks for any and all help.

Earthlink's code:
<h1>Sample Form</h1>
<hr>
<form method="post" action=" http://www.domain.com/cgi-bin/mailto"> 
<input type="hidden" name="RECIPIENT" value="user@domain.com"> 
<input type="hidden" name="THANKURL" value=" http://www.domain.com/thankyou.html"> 
<p> 
<b>Name:</b><input type="text" name="name" size="30"><br> 
<b>Email:</b><input type="text" name="email" size="30"><p> 
<b>Comments:</b><br> 
<textarea name="comments" rows="10" cols="50"></textarea>
<p> 
<input type="submit" value="Send"> 
<input type="reset" value="Clear"> 
</form> 
<p>


My Flash Code:
stop();

send_btn.onRelease = function() {
var my_lv:LoadVars = new LoadVars();

my_lv.firstName = firstName_txt.text;
my_lv.lastName = lastName_txt.text;
my_lv.email = email_txt.text;
my_lv.phone = phone_txt.text;

if (firstName_txt.text != "" && lastName_txt.text != "" && email_txt.text != "" && comments_txt.text != "")
{
my_lv.send(" http://www.domain.us/cgi-bin/mailto:me@domain.us","_blank","POST");
gotoAndStop("success");
}
else
{
gotoAndStop("error");
}
}
This topic has been closed for replies.

95 replies

April 21, 2007
Yes
kglad
Community Expert
April 21, 2007
if you only have one checkbox then, in that movieclip's frame you should be able to use:

kglad
Community Expert
April 21, 2007
are the textfields and checkboxes in the same movieclip and if so, are they in the same frame?
kglad
Community Expert
April 18, 2007
you're welcome.
April 21, 2007
I thought this journey was over but I guess not. I've been trying to configure the checkboxes that will show up with the text fields and no matter how I do it, one or the other doesn't work. When I remove the lv=new LoadVars, as you suggested, none of the text fields load. I, obviously, am configuring something wrong. I'm attaching the text code that works and attaching one of the checkbox code in a second post. Would you please check out both and show me in what order they should be and if the checkbox code is correct. Thanks again, I really thought I had this licked.
April 21, 2007
This is the code for the checkbox. The name of the checkbox is: gcdesign and the label is : Golf Course Design
April 18, 2007
Thanks for all your help. Thanks to you, I've learned a lot. You are the Master!
April 17, 2007
When they check each box it can either be a Yes or the instance name. If they don't check it then nothing shows.

Company, address, etc each have text fields but in the swf file they are not active, but the name, email and phone is.
kglad
Community Expert
April 18, 2007
because you're using checkboxes it's best to create your loadvars object when you enter the frame that contains the check boxes instead of creating it when your send button is released. the code below will add the checkboxes that are selected to the loadvars and indicate they were checked by assigning them the value of "yes". unchecked check boxes won't appear in your email.

to find out why some textfields are not appearing in your email post a link to your fla and specify the location of your form and submit button, if it's not obvious.

kglad
Community Expert
April 17, 2007
well, what is it that you want to send in your email? the selected checkboxes instance name? its label?

and i don't know the paths/instance names to your textfields. if company_txt where the name of a textfield and it contained text and it's on the same timeline as phone_txt, it wouldn't be undefined in your email. so, at least, one of those things is not true.
kglad
Community Expert
April 17, 2007
i'm not familiar with that version of the formmail script. edit the From line and put your email address there.

you need correct path/instance name references for your other textfields and those textfields all need to exist when the lv.send() is executed.

and you need to assign a property to your loadvars (lv) to indicate which checkbox is selected. what are you using now?
April 17, 2007
I'll fix the cgi "From" code.
Aren't the paths to the other text field referenced in the attached code?

I have no idea what you're talking about by "assigning a property..." When I select the Check Box in the flash file, there is nothing that can be added in the properties panel.

I apologize for being such a dunce! I will never put a FORM in a Flash site again.
April 17, 2007
I updated my flash player and it works in all browsers : IE, Safari & netscape.
Now that we've got it working, should I go back to the original coding in Flash, because none of the other text fields work and there are 4 check boxes that don't show up. should I lv. the check boxes? They are labeled. Any thoughts on why the email address goes to the "From" line the email instead of in the list?
kglad
Community Expert
April 17, 2007
make sure the flash player in your safari browser is the same version or later than the version you use in ie.
April 17, 2007
OK, I think we've made som progress. What I did was change the first line in the cgi script to: #!/usr/local/perl588/bin/perl -wT

and changed the flash script to: lv.send("cgi/FormMail.pl","POST");

and it worked in IE, but not in Safari. Safari couldn't find the FormMail.pl script

The name and phone # were there. Everything else was labeled "undefined" because none of the text boxes were active in the flash page.

The email address was in the From: line of the return email. See below.

X-ELNK-Loop: db@davidbrewer.com
Date: Tue, 17 Apr 2007 11:57:07 -0700 (PDT)
To: db@davidbrewer.com
From: db@db.com
Subject: WWW Form Submission
X-ELNK-Received-Info: spv=0;
X-ELNK-Received-Info: sbv=0; sbrc=.0; sbf=00; sbw=010;
X-ELNK-Info: spv=0;
X-ELNK-AV: 0
X-ELNK-Info: sbv=0; sbrc=.0; sbf=00; sbw=010;

Below is the result of your feedback form. It was submitted by
(db@db.com) on Tuesday, April 17, 2007 at 11:57:07
---------------------------------------------------------------------------


country: undefined

zip: undefined

state: undefined

city: undefined

street: undefined

company: undefined

phone: 555-345-6789

name: David Brewer

---------------------------------------------------------------------------