Adapting a swf form to an existing php

Hi everyone!
I’m trying to create a contact form with the possibility of attaching a file to it, and send to email.
I manage to do this in html/php using phpMailer.

But now i’m trying to use the same php I use in the html/php form, and adapt a swf contact form to it (i don´t now if its possible…)

In SWF normally i when i upload a file to server, i use the filereference, and point to a php file to do the uploading.
The php script that I have as a uploadFile function in it.
How can i use the function in the php, and make it work in swf? instead of using a php file just for the upload part, I want to use the php file that have all the functions…

Did I made myself clear??? Thanks people!!!

All you need to do is pass the FileReference.upload method the URL to the php script. Use the same URL that you would set in the action attribute of an html form. The swf will send a HTTP request just like the HTML form