A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: formmail.pl

  1. #1
    Junior Member
    Join Date
    Jan 2007
    Posts
    8

    formmail.pl

    Hello everyone, I have been searching for days but nobody seems to have the same problem I have (because I am so noob to this, I must be missing something super simple...)

    I cannot get a simple form to mail out from flash.

    Here is the code that I have in my submit button, courtesy of lynda.com. Problem is they do not explain anywhere how to make it work...
    Code:
    var gatherForm:LoadVars = new LoadVars();
    
    function sendForm() {
    	gatherForm.email_to = "ch@fakeemail.com";
    	gatherForm.visitor_name = contactForm.userName.text;
    	gatherForm.visitor_email = contactForm.userEmail.text;
    	gatherForm.visitor_comments = contactForm.userComments.text;
    	
    	gatherForm.send ("/cgi-bin/formmail.pl", "_blank", "POST");
    	
    	
    }
    
    
    
    this.contactForm.submitBtn.onRelease = function() {
    	
    	if (contactForm.userName.text == "" || contactForm.userEmail.text == "" ||
    		contactForm.userComments.text == "") {
    		gotoAndStop(10);
    	} else {
    		sendForm();
    		gatherForm.visitor_name = contactForm.userName.text;
    		gotoAndStop(20);
    	
    }
    }
    	
    }
    I went into my Network Solutions web admin and setup a MySql database named 'blend' with the 4 fields: email_to, visitor_name, visitor_email, visitor_comments.

    (I have no idea where I need to refer to this mysql database, I am not even sure if i need it.)

    Lastly I downloaded a formmail.pl script (http://scriptarchive.com/formmail.html), made a folder named cgi-bin, and loaded it up to my site.

    the processing thing is located at /usr/sbin/sendmail, says network solutions.

    This is how I set up the file:
    Code:
    $mailprog = '/usr/sbin/sendmail -i -t';
    @referers = ('myclientsdomain.com','myowndomain.com'); 
    @recipients = &fill_recipients(@referers); (left unchanged)
    @valid_ENV = ('REMOTE_HOST','REMOTE_ADDR','REMOTE_USER','HTTP_USER_AGENT'); (left unchanged)
    My problem is that nothing really seems to tie together and I have no clue how to test if it is working. This is an error I get after submitting:
    Code:
    Page Not Found
    
    We cannot locate the page you're looking for. Please check the address and make sure all letters are lowercased with no spaces. You may also move to a different page by using the links in the menu bar above.
    I have a client who is really really upset and this is the only thing stopping me from getting paid.

    Any help is greatly appreciated. If this post is confusing, can somebody just help me send a simple form from flash? I need people to be able to send in their name, email, and comments. Thats it.


    I am also very new to message boards in general. Please understand

  2. #2
    Registered User
    Join Date
    Feb 2001
    Posts
    13,041
    Hi,

    it really sounds like things dont fit together. In a long time, I remember just one host where I had cgi access but had to create the cgi-bin directory myself. Since you have mysql, I would sort of expect php as well. You could try to upload a file test.php to your regular web directory with just that one line in it
    Code:
    <? phpinfo(); ?>
    and try to view it in a browser.

    Musicman

  3. #3
    Junior Member
    Join Date
    Jan 2007
    Posts
    8
    the only code that lynda.com gave me was the code above, which I suppose I can change to php if needed.

    thing is, does anyone know how to get ANY TYPE of form working in flash? it seems everywhere I look, the information is wrong for my situation. I built a php form before but I have absolutely no clue how that would fit into flash.

    so, if anyone knows how to connect this flash code to where it actually works that would help, but I am up for any options that will email 3 simple fields.

    It seems so easy but I have been stressing for months on this issue.

    Thanks everyone.

  4. #4
    Registered User
    Join Date
    Feb 2001
    Posts
    13,041
    Hi,

    if php works on your system, you could just use the flash code you have, replace /cgi-bin/formmail.pl by echo.php, and put up this echo.php file
    Code:
    <?
    foreach($_POST as $key => $val)
        print "$key => $val<br>";
    ?>
    Since your script opens a new browser page, you should see your variables listed on the page

    Musicman

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center