Using flash to passing variables onto a php application on a server

Hi there,

I am wanting use flash to pass some variables onto a php script on a webserver only problem is how can i pass flash variables onto a php script on a webserver would i have to use $_GET[‘’]; to recieve the variables on the php side and is there anything else i’d need to do to recieve them on php side,

What would i have to do post the variables from flash to php on flashes end?

If anyone can help me on these 2 Questions it would be great,

Thanks,William

here’s a sample

create a button and put this action in it :


on(release) {

myName = "stone deft";
getURL("reviever.php", "", "POST");

}

php:

echo $_POST['myName'];

okay on the other hand if i want to post data to a flash file would it be the same process?

yes via flashvars

flashvar is that a php or flash function?

also,

if i was doing somthing like this for php


$var=$_GET['var1'];
$varr=$_GET['var2'];
//
select * from table where id='$var';
 //
```php

check the data from database then post the database data from the php file back to the flash file how should i do it with it with php posting to the flash file can anyone give me a sample or would i have to do the above calculations myself?

but how can i achieve that??

is it same process?

Flashvars is used to pass variables inside flash example:

using get with the url www.mysite.com?var=stonedeft&id=12

in your embed code (I’ll be using swfoject.js to embed this example)

<?
$myvar = $_GET['var'];
$id = $_GET['id'];
?>


<script type="text/javascript" >
   var so = new SWFObject("/flash/form.swf", "", "550", "400", "9", "#ffffff");
    so.addParam("FlashVars", "myvar=<? echo $myvar ?>&id=<? echo $id ?>");
	so.addParam("quality", "high");
	so.addParam("menu", "false");
	 so.addParam("wmode", "transparent");
	so.write("commentForm");
</script>

note:
so.addParam(“FlashVars”, “myvar=<? echo $myvar ?>&id=<? echo $id ?>”);

The above script will pass stonedeft(myvar) and 12(id) to form.swf

inside form.swf you can now access the variables with _root.myvar and _root.id

Cheers

ah okay that makes perfect sense does file posting it have to require the swf embbed coded too or not??