1 2 3 Previous Next 113 Replies Latest reply on Apr 26, 2007 4:44 AM by dbthumb

    Earthlink CGI script and Flash

    dbthumb
      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");
      }
      }
        • 1. Re: Earthlink CGI script and Flash
          kglad Adobe Community Professional & MVP
          use:

          • 2. Re: Earthlink CGI script and Flash
            dbthumb Level 1
            Thanks, so the only thing you really changed on my code is adding "my_lv.RECIPIENT="me@domain.us"; ? 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?
            • 3. Re: Earthlink CGI script and Flash
              kglad Adobe Community Professional & MVP
              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.
              • 4. Re: Earthlink CGI script and Flash
                dbthumb Level 1
                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.
                • 5. Re: Earthlink CGI script and Flash
                  kglad Adobe Community Professional & MVP
                  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?
                  • 6. Re: Earthlink CGI script and Flash
                    kglad Adobe Community Professional & MVP
                    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?
                    • 7. Re: Earthlink CGI script and Flash
                      dbthumb Level 1
                      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.
                      • 8. Re: Earthlink CGI script and Flash
                        kglad Adobe Community Professional & MVP
                        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.
                        • 9. Re: Earthlink CGI script and Flash
                          dbthumb Level 1
                          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:

                          Not Found
                          The requested URL /cgi-bin/mailto:info@dvl.us 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.

                          • 10. Re: Earthlink CGI script and Flash
                            kglad Adobe Community Professional & MVP
                            there should be nothing after mailto. remove that colon and the email address that follows the colon.
                            • 11. Re: Earthlink CGI script and Flash
                              dbthumb Level 1
                              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.
                              • 12. Re: Earthlink CGI script and Flash
                                kglad Adobe Community Professional & MVP
                                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.
                                • 13. Re: Earthlink CGI script and Flash
                                  dbthumb Level 1
                                  OK. I'll get a HTML form working with the same input text boxes and 4 check boxes.
                                  Is this what I should do?
                                  • 14. Re: Earthlink CGI script and Flash
                                    kglad Adobe Community Professional & MVP
                                    no, you would use the html example form from el and see if it works:

                                    <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>
                                    • 15. Re: Earthlink CGI script and Flash
                                      dbthumb Level 1
                                      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 ?
                                      • 16. Re: Earthlink CGI script and Flash
                                        kglad Adobe Community Professional & MVP
                                        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?
                                        • 17. Re: Earthlink CGI script and Flash
                                          dbthumb Level 1
                                          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.
                                          • 18. Re: Earthlink CGI script and Flash
                                            dbthumb Level 1
                                            The cgi folder on el has nothing in it.
                                            • 19. Re: Earthlink CGI script and Flash
                                              kglad Adobe Community Professional & MVP
                                              well, let's see if it's using some sort of redirect. otherwise you're going to need a cross-domain policy:

                                              • 20. Re: Earthlink CGI script and Flash
                                                dbthumb Level 1
                                                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
                                                • 21. Re: Earthlink CGI script and Flash
                                                  kglad Adobe Community Professional & MVP
                                                  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.
                                                  • 22. Re: Earthlink CGI script and Flash
                                                    dbthumb Level 1
                                                    Great. Thanks. As Arnold would say, "I'll be back!"
                                                    • 23. Re: Earthlink CGI script and Flash
                                                      kglad Adobe Community Professional & MVP
                                                      ok, let's see what happens.
                                                      • 24. Re: Earthlink CGI script and Flash
                                                        dbthumb Level 1
                                                        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.
                                                        • 25. Re: Earthlink CGI script and Flash
                                                          dbthumb Level 1
                                                          Here's the code I put in:
                                                          • 26. Re: Earthlink CGI script and Flash
                                                            kglad Adobe Community Professional & MVP
                                                            ok, that's progress. if your el website is www.davidbrewer.com use:

                                                            • 27. Re: Earthlink CGI script and Flash
                                                              dbthumb Level 1
                                                              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.
                                                              • 28. Re: Earthlink CGI script and Flash
                                                                dbthumb Level 1
                                                                This is where the test site sits; http://www.davidbrewer.com/DVL/DVL.html
                                                                • 29. Re: Earthlink CGI script and Flash
                                                                  kglad Adobe Community Professional & MVP
                                                                  your swf being in DVL is significant. let's try:



                                                                  • 30. Re: Earthlink CGI script and Flash
                                                                    dbthumb Level 1
                                                                    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."
                                                                    • 31. Re: Earthlink CGI script and Flash
                                                                      kglad Adobe Community Professional & MVP
                                                                      go to

                                                                      https://cc.earthlink.net/control-center/login.jsp?redirect=%2Fcontrol-center%2Findex.jsp%3 Fx%3D-1927715346&x=2058171029

                                                                      login and search for some security check that earthlink performs for their email form or some faq about using flash and email forms.
                                                                      • 32. Re: Earthlink CGI script and Flash
                                                                        dbthumb Level 1
                                                                        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.
                                                                        • 33. Re: Earthlink CGI script and Flash
                                                                          kglad Adobe Community Professional & MVP
                                                                          what did you set permissions on?
                                                                          • 34. Re: Earthlink CGI script and Flash
                                                                            dbthumb Level 1
                                                                            rwx r-x r-x
                                                                            • 35. Re: Earthlink CGI script and Flash
                                                                              kglad Adobe Community Professional & MVP
                                                                              on what file (or directory) did you set permissions?
                                                                              • 36. Re: Earthlink CGI script and Flash
                                                                                dbthumb Level 1
                                                                                The CGI folder
                                                                                • 37. Re: Earthlink CGI script and Flash
                                                                                  kglad Adobe Community Professional & MVP
                                                                                  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.
                                                                                  • 38. Re: Earthlink CGI script and Flash
                                                                                    dbthumb Level 1
                                                                                    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.
                                                                                    • 39. Re: Earthlink CGI script and Flash
                                                                                      kglad Adobe Community Professional & MVP
                                                                                      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";
                                                                                      1 2 3 Previous Next