Version: 1.0
Type: Sample Code (HOWTO)
Category: Other
License: GNU General Public License
Description: Sample send-recieve data from Flash to PHP script and return to Flash
<?php
//This script receive from Flash than send data to Flash movie
//
//You need additional *swf file, where whill be vaiables txt_input and
// txt_from_flash as text fields. Create button in flash movie that send
// variables to script using Load Variables ("getvar.php", "", vars=GET)
//or vars=POST
if ($QUERY_STRING!=""){
parse_str(urldecode($QUERY_STRING));
print "txt_input=This data recieve GET\n$txt_from_flash";}
elseif($REQUEST_METHOD=="POST"){
parse_str($HTTP_POST_VARS);
print "txt_input=This data recieve POST\n$txt_from_flash";
}
else{
if ($REQUEST_METHOD=="POST"){
print "txt_input=POST";}else{print "txt_input=GET";}
?>