Expand my Community achievements bar.

PHP / FLEX 2 Variables

Avatar

Level 1
Well I have a question I know how to retrieve information via
PHP connecting to the mysql then turning the information to XML and
then having Flex read it.



But I do not know how to send a variable from Flex to PHP; so
PHP can read it in order for me to use that value / variable in PHP
and then return some other information back to Flex.
1 Reply

Avatar

Level 1
You can send varibles by wrapping them in a HTTPService
request each variable you want to send wrap in a mxml tag ie in php
= $phpVariable, $phpVariable2, then you send your variables from
flex as follows. (phpVariable2 is sent from a user input form item
called phpUserVariable)

<mx:HTTPService id="phpRequest" url="PHP.php"
useProxy="false" method="POST" >

<mx:request>


<phpVariable>phpVariabletoSend</phpVariable><phpVariable2>{phpUserVariable.text}</phpVariable>

</mx:request>

</mx:HTTPService>