# AS3 / PHP Form

**URL:** <https://forum.kirupa.com/t/as3-php-form/295653>\
**Category:** flash\
**Created:** [September 2, 2009, 1:21pm UTC](https://forum.kirupa.com/t/as3-php-form/295653 "2009-09-02T13:21:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SLaY](https://avatars.discourse-cdn.com/v4/letter/s/ac91a4/32.png) [@SLaY](https://forum.kirupa.com/u/SLaY)\
**Post date:** [September 2, 2009, 1:21pm UTC](https://forum.kirupa.com/t/as3-php-form/295653/1 "2009-09-02T13:21:46Z")

</div>

Hey, I’m doing for the first time a form in AS3 / PHP and I’d like to know if the AS3 part of the code is correct:

```auto

var loader:URLLoader = new URLLoader();
var req:URLRequest = new URLRequest("contact.php");
var variables:URLVariables = new URLVariables();
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
req.method = URLRequestMethod.POST;

var phpPath:String = "http://localhost/S2Design/";

form.send_btn.buttonMode = true;

form.send_btn.addEventListener(MouseEvent.CLICK, sendForm,false,0,true);
function sendForm(evt) {
      variables.senderEmail = form.email_txt.text;
      variables.senderSub = form.subject_txt.text;
      variables.senderMsg = form.message_txt.text;
      req.data = variables;
      loader.load(req);
   }

```

This is only the ‘hard part’ of the code, without success or loading messages, is this correct ? Are all the variables sent to the contact.php? Or am I missing something?

Tks
