1 Reply Latest reply on Aug 21, 2007 4:20 AM by Newsgroup_User

    submit form using flash 8 UI components and php

    dezign4live
      Hi all

      I want to create a submit form using flash 8 UI components and php,

      The fileds are [Text Input]
      1. First Name[Text Input]
      2. Last Name[Text Input]
      3.Email[Text Input]
      4.Hear About Us [Combo Box]
      5.submit[Button]

      After pressing the submit button i want to revieve a mail what the end user submits

      Pls help me
      Thanks In Advance

        • 1. Re: submit form using flash 8 UI components and php
          Level 7
          Look in the Help at the LoadVars class. It's sendAndLoad method is what you
          want.

          var sv = new LoadVars();
          var rv = new LoadVars();

          rv.onLoad = function(success){
          if(success){
          trace("mail sent");
          }
          }

          sv.firstName = fnameField.text;
          sv.lastName = lnameField.text;
          ...
          sv.sendAndLoad("url_of_sendmail.php_script", rv);

          Then all you need is a little PHP script to receive and process the data:

          <?PHP
          $fname = $_POST['firstName'];
          $lname = $_POST['lastName'];
          ...
          $message = "$fname $lname says hello.";

          $ret = mail("to_email", "subject", $message);

          exit($ret);
          ?>

          You should have some error checking and such, but this is the bare bones...

          --
          Dave -
          Head Developer
          http://www.blurredistinction.com
          Adobe Community Expert
          http://www.adobe.com/communities/experts/