Howto Integrating Flash file in PHP document [1/2]

Type: Code
Level: Intermediate   
Date: 2007-May-05
Visited: 2788 times
Rating:
Author: Alex Plumpton

This is a lesson that will show you how to transform variables from Flash clip to PHP script Means to Learn.

Settings of the Flash player
Make an Input Box with the Text tool. You have to give a name for the impute box in the text properties pannel. You can choose the name by yourself but you have to remember it because you will use it in the PHP script.

I made 3 Input boxes. I named them "name","age",and "eye". I guess they are easy enough to be remembered?
Ok now you will need a button to open the PHP page. To open a new page in Flash use the action script and especially the variables getURL().This is the code:

submit.onPress = function () {
      
getURL ("getVars.php""_blank""POST");
}
Interpret the code:Means to Learn.

1. getVars.php is the name of the PHP file witch you are going to use;
2. _blank makes the butting which is opening the page;
3. POST is the method in which to transfer the variables. The other option is GET.

The PHP code:

<?
// Receiving the variables.
$name $_POST['name'];
$age $_POST['age'];
$eye $_POST['eye'];

// Printing out the variables.
print "Your name is "$name ".";
print 
"You are "$age ." years old.";
print 
"You have "$eye ." eyes.";
?>
- Howto Integrating Flash file in PHP document [1/2] -

Need a specific tutorial? Do not hesitate and submit a request!
Related Tags: integrating a flash file in a php  integrating a flash file in a php program  how to post a flash document on php file  integrating flash and php  integrating flash in php  integrating php and flash  integrating php and flash  integrating flash and php  integrating flash and php  integrating php to flash