Skip to main content
April 11, 2007
Question

Earthlink CGI script and Flash

  • April 11, 2007
  • 95 replies
  • 24236 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

kglad
Community Expert
Community Expert
April 16, 2007
is it formmail.pl?
April 16, 2007
I've found a quality perl script (I think) but have no idea what part(s) or all I really need. Can I paste it here or in the code window for you to look at and maybe you can tell me which parts or all that I need to upload. Just let me know if you really want to continue on this neverending project or not and, if you do, which do you want me to do, paste or attach. It seems like a pretty long code with explanations.
kglad
Community Expert
Community Expert
April 16, 2007
the flash coding is not the problem. there's some security check on el's part that's not accepting a call to their mailto script from a swf.

if you use a php or perl mail script you won't have the security problem and that seems the best route to go. i can help with both but i've been using php more lately so i can help more with php.
April 16, 2007
I still get the same message. Are we fighting a loosing battle here? What if I upload a CGI form script to my CGI folder and use that to process the form? There are many on the internet. Or, maybe using a totally different flash script? You've spent so much time helping me and, without any help from EL, you/we seem to be swimming upstream and there's a Bear with his mouth open just waiting to chomp!
kglad
Community Expert
Community Expert
April 16, 2007
that's probaby not helpful because there's nothing in there.

the problem is not a flash coding problem unless that redirect to their mail program is on another domain (which seems highly unlikely). you should call customer support and ask them what kind of security check is occuring that won't let you access their mail form from a website on their domain.
April 16, 2007
I've been on the phone with EL for an hour and they don't support personal scripts and said that if I follow these 3 steps it should work. I took the swf and it's html page out of the DVL folder and put it in my root folder thinking that might help, but still get the same "Must be hosted at EL" message. I'll attatch the code again

Here are their steps again:
Once you've created your form, you will need to set the METHOD of the form to POST and the ACTION of the form to http://www.domain.com/cgi-bin/mailto where domain.com is the name of your domain. The final code will look like the following.
<FORM METHOD="POST" ACTION=" http://www.domain.com/cgi-bin/mailto">

where domain.com is your domain name.

You will also need to add the two hidden fields below in between the begin form tag and the end form tag:
<INPUT TYPE="HIDDEN" NAME="RECIPIENT" VALUE="user@domain.com">

<INPUT TYPE="HIDDEN" NAME="THANKURL" VALUE="URL_for_a_thankyou_page">

where user@domain.com is the email address to which you want the data from the form sent and URL_for_a_thankyou_page is the URL of a page (e.g., http://www.acme.com/thankyou.html) that you will need to create telling the user that the data from the form has been sent.
kglad
Community Expert
Community Expert
April 16, 2007
i doubt this will work but try adding a ThankYou.html page even though you don't want to use one. (you can work-around using a redirect later to get back to your swf, if needed) and change the THANKURL to an absolute path:

lv.THANKURL=" http://www.davidbrewer.com/ThankYou.html";
April 15, 2007
The CGI folder
kglad
Community Expert
Community Expert
April 15, 2007
on what file (or directory) did you set permissions?
April 15, 2007
rwx r-x r-x
kglad
Community Expert
Community Expert
April 15, 2007
what did you set permissions on?
April 14, 2007
I've set the permissions right. There was no Info related to Flash. I've copied what I think might be pertinent:

PHP
PHP is a server-side scripting language. Like Perl scripts, PHP is executed 'on-the-fly' by your Web server. Unlike Perl, PHP scripts are embedded within your HTML files, making scripts easier to read, debug and understand.
Many Web-specific functions are built into PHP, facilitating advanced Web features such as form interpretation, cookies, http-header manipulation, database access, automatic headers and footers, dynamic page generation, etc. Learn more about PHP.
Supported PHP Versions
Your Web Hosting account supports PHP versions 4.1.2 and 5.0.5. PHP scripts are denoted by their extension, either .php4 or .php5. Files that end in .php4 will be interpreted by PHP 4.1.2, and those that end in .php5 will be interpreted by PHP 5.0.5.
Note: PHP 4.1.2 is supported only for backward compatibility with existing scripts, and will be phased out at some point in the future. We strongly recommend that new customers use version 5.0.5 (.php5).
Using .php Extensions
To use the extension '.php' for your PHP scripts, add the following line to your .htaccess file:
        AddHandler php5-script .php
The example above will result in files that end in .php being interpreted by PHP 5.0.5. To have them interpreted by PHP 4.1.2, change "php5-script" to "php4-script"
Note: Although your Web site is equipped with PHP, Customer Support cannot assist in the creation or maintenance of PHP scripts.

Executing Scripts
Scripts are worthless if you can't execute them. There are two ways to execute a script on your Web hosting account:
From a Web Browser
To execute a script in the /cgi directory, load the script directly from a Web browser using the following format:
  http://www.yourdomain.com/cgi/script_name.php
From a Web Page Form
Aside from accessing a script via an URL, you can also have a Web page execute a CGI script directly from an interactive form.
To execute your CGI from a form on a Web page, use the following format in your HTML code:
 <FORM ACTION = "/cgi/script_name.php">
Note: Scripts will not run unless you remember to set the permissions of your script to 755 (rwxr-xr-x).

Uploading Scripts
Using an FTP Client
To Upload a CGI Script Using FTP:
1. Using your favorite FTP client, connect to your Web server.
2. Upload your scripts to the /webdocs/cgi directory.
3. Using your FTP client, change the permissions of the file you uploaded to 755 (rwxr-xr-x) so that it can be executed.
Note: Don't forget to upload scripts to your /webdocs/cgi directory as text files and upload compiled binaries as binary files.

Troubleshooting
The following are some general problems that may occur when trying to implement scripts on your Web site.
• Double-check the first line in your Perl CGI script
•  Perl 5.008008 (5.8.8)
#!  /usr/local/perl588/bin/perl
• Perl 5.004_04
#!  /usr/local/bin/perl
• Perl scripts must be in Unix text format.
• The correct format for CGI files is ASCII (or text) format. Double check to make sure that your FTP Client has ASCII or text selected.
• Compiled executables must be uploaded in binary mode.
• If necessary, make sure the script is in the /cgi directory.
• Make sure permissions for all scripts are set to 755.
If the CGI script was found on another Web site, you may need to modify the script to get it to work. Most CGI scripts available online come with documentation.