How to pass PHP variables in Flash?

A

Anonymous

Guest
Good Day!

Can any one help me or give me an example on how to pass php values in flash?

Your Help is greatly appreciated....
 
Sending from Flash to PHP right !?

For example, let's say you have a flash based email form.
Give fields a suitable name like name, email and message.

You must use loadVariablesNum() as we'll send these variables to PHP.
The send code in your flash file should be something like (example):

Action Script code:
Code:
<?php // PHP code block for Hilite purposes only

sendButton.onPress = function(){
       loadVariablesNum("mail.php", 0, "POST");
}

?>
This takes the variables from level "0" and sends them to the script in the mail.php file using the POST method.

Your mail.php file will look something like (as same):
Code:
<?php

$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];

// And use them

?>
That's all :)
 
Hello master gesf!

Nope from php to flash. Passing Variables in php to Flash.

I have the Code in the php like this:

PHP Code

Code:
  <?php

  echo"< a href =\"php_flash.php?xml_name = gallery\" > test 1</a> "   

  ?>

then i want that the query string value in the php will get by the flah

Then My action SCript Code

Code:
onEnterFrame = function(){

xml_name = new LoadVars();

xml_name .load("http://localhost:81/freshfire/photogallery/php_flash.php",this,"GET");

xml_name .onLoad = function() {
	
xml_text.text = this.xml_name; // passing the query string xml_name from php to xml_text the instance 
                                              //name of the  text box in flash

}

	
};

But i get the value undefiend in the flash.

Thanks a lot for the help...
 
Try something like:
Code:
<?php // PHP code block for Hilite purposes

variables = new LoadVars();
retrieve_variables = new LoadVars();
variables.sendAndLoad("http://localhost:81/freshfire/photogallery/php_flash.php", retrieve_variables, "POST");

?>
 
Back
Top