• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
1

Earthlink CGI script and Flash

Guest
Apr 11, 2007 Apr 11, 2007

Copy link to clipboard

Copied

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");
}
}
TOPICS
ActionScript

Views

23.2K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
replies 113 Replies 113
Community Expert ,
Apr 17, 2007 Apr 17, 2007

Copy link to clipboard

Copied

that's not the formmail.pl script i'm familiar with from matt's script archive. but you can give it a try. i'd change @recipients though:

@recipients = ('^db\@davidbrewer\.com');

rename the file and remove the .txt to create FormMail.pl.
recheck its permissions.

you can use the same flash file but change

lv.RECIPIENT to lv.recipient

and remove

lv.THANKURL

and use:

lv.send("cgi-bin/FormMail.pl","POST");



Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 17, 2007 Apr 17, 2007

Copy link to clipboard

Copied

This is the error message: The requested URL /cgi-bin/FormMail.pl was not found on this server.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 17, 2007 Apr 17, 2007

Copy link to clipboard

Copied

is your swf back in that dvl folder? if so, explain the folder set-up to your swf and to your cgi folder.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 17, 2007 Apr 17, 2007

Copy link to clipboard

Copied

No, it's not in the DVL folder. I even tried it with the -bin removed from the cgi-bin (as EL suggests) path and got a "death threat" message!
Actually it said: 500 Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the site administrator and inform them of the time the error occured and anything you might have done that may have caused the error.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 17, 2007 Apr 17, 2007

Copy link to clipboard

Copied

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

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 17, 2007 Apr 17, 2007

Copy link to clipboard

Copied

make sure the flash player in your safari browser is the same version or later than the version you use in ie.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 17, 2007 Apr 17, 2007

Copy link to clipboard

Copied

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 17, 2007 Apr 17, 2007

Copy link to clipboard

Copied

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 17, 2007 Apr 17, 2007

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 17, 2007 Apr 17, 2007

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 17, 2007 Apr 17, 2007

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 17, 2007 Apr 17, 2007

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 18, 2007 Apr 18, 2007

Copy link to clipboard

Copied

Thanks for all your help. Thanks to you, I've learned a lot. You are the Master!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 18, 2007 Apr 18, 2007

Copy link to clipboard

Copied

you're welcome.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 21, 2007 Apr 21, 2007

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 21, 2007 Apr 21, 2007

Copy link to clipboard

Copied

This is the code for the checkbox. The name of the checkbox is: gcdesign and the label is : Golf Course Design

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 21, 2007 Apr 21, 2007

Copy link to clipboard

Copied

are the textfields and checkboxes in the same movieclip and if so, are they in the same frame?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 21, 2007 Apr 21, 2007

Copy link to clipboard

Copied

Yes

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 21, 2007 Apr 21, 2007

Copy link to clipboard

Copied

if you only have one checkbox then, in that movieclip's frame you should be able to use:

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 21, 2007 Apr 21, 2007

Copy link to clipboard

Copied

There are actually 4 checkboxes. Should I just repeat each as shown? And just change each checkbox name?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 21, 2007 Apr 21, 2007

Copy link to clipboard

Copied

instead of

gcdesign.addEventListener("click", gcdesignListener);

you should have four lines like:

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 22, 2007 Apr 22, 2007

Copy link to clipboard

Copied

Should I also repeat this top code for each checkbox?
gcdesignListener = new Object(); / / ie:1,2,3
lv=new LoadVars();
gcdesignListener.click = function(eo:Object) {
if (eo.target.selected) {
cb = eo.target.label;
lv.cb = "yes";

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 22, 2007 Apr 22, 2007

Copy link to clipboard

Copied

no. you only need to add the same event listener to each event object or checkbox.

so, you should have one loadvars (lv), one event listener (gcdesignListener), and one listener method (gcdesignListener.click).

your choice of name for the listener may confuse you. you might want to change that back to lo (just a plain old vanilla listenerobject). or you could call it cbListener (for checkbox listener), if you like fancier names.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 22, 2007 Apr 22, 2007

Copy link to clipboard

Copied

Gotcha! I'm finally grasping the concept. Finally! I sure hope someone is paying you big bucks for all your free expertise. If not, you're a Master and a SAINT! Thanks, again.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 22, 2007 Apr 22, 2007

Copy link to clipboard

Copied

well, if i got a penny for every message i'd have over $200 and that would be $200 more than i actually get.

but i knew that before i answered any questions.

and you're welcome.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines