3 Replies Latest reply on Sep 12, 2007 10:53 AM by SymTsb

    AS and PHP email form

      Hi, I'm trying to send variables from a swf form to a PHP script on a server that is supposed to email automatically. So far haven't been successful. I know the PHP script works because I tried it with other swf forms. Any help would be nice. Thanks in advance!

      Here's my ActionScript:

      submit.onRelease = function() {

      formData = new LoadVars();
      formData.firstname = firstname;
      formData.lastname = lastname;
      formData.address1 = address1;
      formData.address2 = address2;
      formData.city = city;
      formData.state = state;
      formData.zip = zip;
      formData.email= email;
      formData.workphone = workphone;
      formData.homephone= homephone;
      formData.questions = questions;
      formData.bedrooms = bedrooms.getValue();
      formData.interested_in = "\n";
      formData.amenities = "\n";
      formData.hear_about_us = "\n";
      formData.otherText = otherText;


      // Gather the order information into a LoadVars instance.;
      // Get and Return Checkbox Values

      //--------Interested in -------------------//
      if (cb_primary.getValue() == true) {
      formData.interested_in += "\t\tPrimary Residence\n"
      }
      if (cb_secondary.getValue() == true) {
      formData.interested_in += "\t\tSecondary Residence\n"
      }
      if (cb_corporate.getValue() == true) {
      formData.interested_in += "\t\tCorporate Apartment\n"
      }
      if (cb_investment.getValue() == true) {
      formData.interested_in += "\t\tInvestment\n"
      }

      //--------Amenities -------------------//

      if (cb_concierge.getValue() == true) {
      formData.amenities += "\t\tConcierge Services\n"
      }
      if (cb_maid.getValue() == true) {
      formData.amenities += "\t\tMaid/Valet Services\n"
      }
      if (cb_location.getValue() == true) {
      formData.amenities += "\t\tLocation\n"
      }
      if (cb_technology.getValue() == true) {
      formData.amenities += "\t\tTechnology\n"
      }
      if (cb_terrace.getValue() == true) {
      formData.amenities += "\t\tTerrace/Outdoor Space\n"
      }
      if (cb_food.getValue() == true) {
      formData.amenities += "\t\tFood Service\n"
      }
      if (cb_fitness.getValue() == true) {
      formData.amenities += "\t\tFitness Center\n"
      }
      if (cb_valet.getValue() == true) {
      formData.amenities += "\t\tValet Parking\n"
      }

      //--------Hear About Us -------------------//

      if (cb_nytimes.getValue() == true) {
      formData.hear_about_us += "\t\tNew York Times\n"
      }
      if (cb_neighborhood.getValue() == true) {
      formData.hear_about_us += "\t\tLive in Neighborhood\n"
      }
      if (cb_broker.getValue() == true) {
      formData.hear_about_us += "\t\tBroker\n"
      }
      if (cb_sign.getValue() == true) {
      formData.hear_about_us += "\t\tSign\n"
      }
      if (cb_other.getValue() == true) {
      formData.hear_about_us += "\t\tOther: " + otherText + "\n"
      }
      if (cb_referral.getValue() == true) {
      formData.hear_about_us += "\t\tReferral\n"
      }

      // Submit data to server
      formData.loadVariables(" http://www.trumpparkavenue.com/mailTest/email.php", "POST");
      _parent.gotoAndStop(35);
      }