Send data to PHP

In order to have a PHP script executed (and not opened in a window) through ActionScript use loadVars.sendAndLoad(url, your_data, method) instead of loadVars.send(url). In this way the opening of a new window isn’t necessary.

example:

ActionScript

  1. // create a new LoadVars instance
  2. var c_lv:LoadVars = new LoadVars();
  3.  
  4. // populate it with some data
  5. c_lv.bericht = input_bericht.text;
  6. c_lv.email = input_mail.text;
  7.  
  8. // offer the data to the PHP mail handler and execute it!
  9. c_lv.sendAndLoad("sendForm.php", c_lv, "POST");