# Php function from AS3 (Flash)

**URL:** <https://forum.kirupa.com/t/php-function-from-as3-flash/323660>\
**Category:** Uncategorized\
**Created:** [July 11, 2011, 5:08pm UTC](https://forum.kirupa.com/t/php-function-from-as3-flash/323660 "2011-07-11T17:08:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Josh\_Martin](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@Josh\_Martin](https://forum.kirupa.com/u/Josh_Martin)\
**Post date:** [July 11, 2011, 5:08pm UTC](https://forum.kirupa.com/t/php-function-from-as3-flash/323660/1 "2011-07-11T17:08:51Z")

</div>

So I’ve done several hours of web searching how to call a php function from flash and found a lot of out of date, or otherwise less than helpful stuff…

So here’s where I’m at. I have a mysql db set up, I have a php file written, and I have a flash swf sitting on an HTML page. I can get the Flash page (via AS3) to open the php file, and execute all of the code there in… this includes using $\_POST to change some data, then UPDATE and SELECT from the db…

What I cannot figure out is how to call a specific php function from AS3. The only two solutions I can think of are to either pass a function name into php using POST and then switch that string to the function it needs to call… or have a seperate .php file for every single “function” I would need to call…

I’ve done some preliminary looking at the amfphp stuff, but that simply looks like a string formatting standard for communication between php and other languages.

Any current links or other help would be appreciated. (Already seen a lot of 6 year old posts from Kirupa, but they seemed dated in their material… is there anything more recent?)
