This content has been marked as final. Show 113 replies
Thanks, so the only thing you really changed on my code is adding "my_lv.RECIPIENT="firstname.lastname@example.org"; ? All I need for it to check is First & last name, email & phone. Correct? I'll give it a shot and see if ELink finds the URL. I appreciate your help. I might be back, OK?
the main thing changed is the address of the mailto script. but yes, i also added the required RECIPIENT variable.
if the html form you displayed is just one example of the forms that can be used by your mailto script, you can probably send any variables you want. otherwise, you'll probably need to limit yourself to the optional variables in the form:
name, email, comments.
Unfortunately it still doesn't work. I've talked to Earthlink all day and they keep saying make the page an external html form so the CGI script will work. It's hard for me to believe that I'm stuck with using a pre-determined external form and not a form created inside a swf file. Is there a simple CGI mailform program that I can upload to my site that will process forms and not have to use Earthlink's 7 year old script. Thanks for the help anyway.
did you test their html form? you should once you can get that to work, you should have no trouble using flash.
i'm a little concerned about that mailto program that has no suffix. normally, that would be mailto.pl or mailto.cgi.
and are you supposed to be using domain.com or your own domain name?
i just checked earthlink's customer support and it looks like you're supposed to ad the mail script through your control center. did you? did you set permissions on the script?
I'm using the real domain name in the script and in the email. I wasn't aware that I had to do the mail script through the control center. After talking with them for 2 days, this is the first time I've heard that. Explain "set permissions" if you would, please. I really appreciate all your time and help.
i'm not sure how you do that because i've never used earthlink's control center. normally files are uploaded to the server and the software that does the uploading (an ftp program) allows you to edit the file permissions.
but before you worry about permissions, you need to add the file to your cgi directory:
Does EarthLink offer any ready-to-run CGI or PHP scripts?
Yes. On our UNIX hosting platform, we provide you with several ready-to-run CGI and PHP scripts that you can add yourself through your Control Center. Some of those include a hit counter, forum, e-mail form, blog and guestbook for your site.
I've activated the CGI script on Earthlink. The Earthlink CGI script is at the top of our conversation. I just can't seem to translate it to my Flash script and/or your revise script (see above). Neither worked. I get the error message:
The requested URL /cgi-bin/mailto:email@example.com was not found on this server.
(This is with my script) and I get the same message with your script. I'm getting brain dead!
Here is the link to the site i'm working on. Go to the contact page(bottom button) and see what error message YOU get. They seem to change a little with each script change. http://www.dvl.us. Hope you'll be here tomorrow. Thanks again for all your help.
there should be nothing after mailto. remove that colon and the email address that follows the colon.
I've regrouped. Being an idiot when it comes to action script and what I need to do after I create a working HTML form and then some how transfer that to my Flash file is becoming so complicated that I don't think it's really worth it. There is a Contact folder in EL's web folder that contains a txt document (which the EL script links to) with the email script for each text input box in their sample form. If I change that to match my form in Flash and link to that, do you think it might work? With absolutely no help from Earthlink, and little documentation in Flash support, I'm walking a road to internet mail hell. The only docs I could find on Adobe was for Dreamweaver forms. I just can't fathom that the process to send a Flash form is this complicated and time consuming. I really appreciate your effort and time spent trying to solve MY problem . Being ignorant is not Bliss.
if you can get a html form working, i can show you how to get your flash form working. otherwise, i don't know what's in any of your server's folders and what you need to setup so the email works.
but there are usually some hurdles to prevent spammers from hijacking your form and using it to send spam. so, you have to know what those hurdles are and those should be listed in the el support.
OK. I'll get a HTML form working with the same input text boxes and 4 check boxes.
Is this what I should do?
no, you would use the html example form from el and see if it works:
<form method="post" action=" http://www.domain.com/cgi-bin/mailto"> <input type="hidden" name="RECIPIENT" value="firstname.lastname@example.org"> <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>
Good morning, kglad. The EL sample form is working perfectly. I changed the "domain" to my site address and the email to my email address for testing. Now what ?
now copy the code for your working html form and paste it to this forum using the attach code option.
also, can you determine if your swf has a subdirectory called cgi-bin that contains your mailto script?
Here's the code. There is onyl a cgi folder on EL server. There is also a Contact folder with an Earthlink.dat document in it.
The cgi folder on el has nothing in it.
well, let's see if it's using some sort of redirect. otherwise you're going to need a cross-domain policy:
I don't want to use the THANKURL. The flash form itself goes to a "success" page. Can I eliminate that line and change the lv.comments to lv.phone? What about checking that they have typed something(required) in First and Last Name, email and phone, if they haven't it goes to an "Error" page. I also have address, city, etc fields that they don't have to fill out if they don't want to. Should I also put in lv.address, lv.city, etc
you can add lv.address etc. it won't hurt anything and if the mail script is worth $.02 it should handle all the variables you send.
but you should send the variables i listed, at least, while testing.
having a non-existant thank you page shouldn't cause a problem if the mail script was properly written. we'll find out if the script tries to open a non-existant page: if you see a 404 page because you have no ThankYou.html, we'll have to check with el support to fix that.
and you can check for empty textfields or correctly formatted email addresses etc before you create the loadvars object.
Great. Thanks. As Arnold would say, "I'll be back!"
ok, let's see what happens.
This is what happened: "Sorry, this CGI is only available to sites hosted with EarthLink, Inc."
The html page title "Bad Referer".
The html address was exactly the same as the SampleForm's that worked: http://www.davidbrewer.com/cgi-bin/mailto.
It never got to the THANKURL page.
I'm sending this in the quick reply box. I'll send another with the code I put in.
Here's the code I put in:
ok, that's progress. if your el website is www.davidbrewer.com use:
This what I get: The requested URL /DVL/cgi-bin/mailto was not found on this server.
I forgot to tell you that the DVL site is in a folder "DVL" in my site. Obviously, this makes a difference in the code. It's there for this testing purpose. Their actual site is up without the form page. Sorry.
your swf being in DVL is significant. let's try:
Just in case you're around today, we're back to the error message: "Sorry, this CGI is only available to sites hosted with EarthLink, Inc."
login and search for some security check that earthlink performs for their email form or some faq about using flash and email forms.
I've set the permissions right. There was no Info related to Flash. I've copied what I think might be pertinent:
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.
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:
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).
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.
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)
• Perl 5.004_04
• 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.
what did you set permissions on?
rwx r-x r-x
on what file (or directory) did you set permissions?
The CGI folder
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.
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="email@example.com">
<INPUT TYPE="HIDDEN" NAME="THANKURL" VALUE="URL_for_a_thankyou_page">
where firstname.lastname@example.org 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.
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: