Hi everyone. I am currently trying to create formmail in Flash. The problem's are: 1) I have NO idea how to get Matt's Script to work! 2) Everyone I know looks at me crazy when I tell them I'm using Matt's formmail.pl. They say it's terrible and unsecure and all that. O.K. Kool. I'll move on. It shouldn't be too hard to find a script for formmail using php and Flash...actually the Flash part is easy, and a given. I just need someone to let me know if Matt's is really that horrible, and if it is, do I need to go get a PHP book and learn all of PHP jus tto create a formmail? CUZ I WILL IF I HAVE TO! hehehehe. jk. a lil php induced rage that's all. or ignorance induced rage. Well thanks for any help, ppl, and I'm sure I'll be talkin to ya soon because after I conquer formmail, I'm off to phpBB!

    Heh, I have read the 'Horror stories' about Matt's scripts also 🙂

    Anyway, this is a poor man's version of formmail made in PHP. Its not supposed to be 'Da Ultimate formmail-script'. I made it one day when I got bored to do the mail-crap all over again for our clients.

    Field 'submit' is the only required field in your form that you must have.

    Field 'email' is optional, but if you want to see the email sender in the From: in email, add it to form.

    And change the $to variable to email you want the form to be sent to.

    Save the script below to something like form.php(or whatever). In flash you just send the form to this file and it should work.

    <?php
    if ($_POST['submit']) {
    	if ($_POST['email'])
    		$from=$_POST['email'];
    	else
    		$from='John Doe < >';
    
    $today=date ("l dS of F Y h:i:s A");
    
    // where to send the email
    $to='someone@somewhere.com';
    
    // get form's names and values to $message(not including submit)
    reset ($_POST);
    $message="This message was sent from ".$_SERVER['HTTP_HOST']." on ".$today."\n\n";
    while (list ($key, $val) = each ($_POST)) {
    	if (!strstr('submit',$key))
    		$message.="$key:\n$val\n\n";
    }
    
    sendmail($from,$to,'WWW-form submission',$message);
    }
    
    function sendmail($from,$to,$subject,$message) {
    $headers  = "MIME-Version: 1.0\r\n";
    $headers .= "Content-type: text/plain; charset=iso-8859-1\r\n";
    $headers .= "From:".$from."\n";
    
    mail($to,$subject,$message,$headers);
    }
    ?>
    

      THANKS A GAZILLION x 2 to INFINITY CAHVA! wow. I can't believe it...sniff...formmail finally!

      P.S. Glad to know someone else heard all the bad things about Matt's!😃 And I copy/pasted the code and saved as CAHVAMAIL!

        15 days later

        HEY CAHVA? ummmm... that script you hooked me up with worked great! Until I lost my flash file. I rebuilt the form, and now, I can't do anything to get it to work! I think I have the variables listed incorrectly. I have a "name" an "email" and a "message", variables in the flash file. The only thing I changed in your script was the email "to" address. Does the script variables cover "name" "email" and "message"? or do I need to rename them? 🙁

          It could be that you changed the form to send via GET method. Use POST method and it should work great.

            on (release) {
            if (email eq "" or message eq "" or name eq "") {
            stop();
            } else {
            loadVariablesNum("CAHVAMAIL.php", "", "POST");
            gotoAndStop(15);
            }
            }

            aight. That's my Actionscript for the button to send in Flash. My text fields are named "name" "email" and "message". Then I have your script in a php file called "CAHVAMAIL" and the only thing I changed was the email addy "Where to send the email"...I know your script works...so that's why I think it's my actionscript...

              Write a Reply...