Php <? H E L P ?>

I have a Flash menu embeded in a php page and want to have the selected page display the proper content without changing pages and have Flash to detect the page and display the proper submenu.

That said, this is what I have tried so far with no luck.

Flash button Script:


on (press) {
    var page = "home"
    getURL ("index.php", "_self", "POST");
}


PHP Script:


<?php 
   $page_id=$_POST['page']; 
?>

If the variable was passed I would add it the embeded flash script like so:


value="flash/header.swf?page_id=< ?php print "page_id"; ?>"

src="flash/header.swf?page_id=< ?php print "page_id";?>"

Any help is greatly appreciated, and if there is a better way to do what I’m aiming for please let me know.

Thanks.

so what exactly are you trying to do? load the variables into Flash? I’m still a little unclear what you are attempting…

I dont think swf files can LOAD variables through this method (“GET”). I haven’t came accross anything like this before. :slight_smile:

You can load the php script using the LoadVars object though. That’ll do it

Jubba -

I’m attempting to pass variables from flash to php when a button is hit.

oh ok, try


<? echo $page_id ?>

instead of what you have. Becuase what you are printing is the string “page_id” you aren’t telling php to print a variable value, you are only telling it to print that string.

Jubba-
can you feed an swf the variables through this method:q:

../flash/header.swf?page_id=< ?php print "page_id";?>"

no. I’ve never tried, but I’m pretty sure you can’t. That would be using the “get” method, but going about it the wrong way…

But thats not what they are trying to do, they say they are trying to send variables from Flash, to PHP and its just not printing out the right way…

oh… i thought so too… but i kinda misunderstood what they’re trying to do :slight_smile:

yeah me too… :slight_smile: I still don’t fully understand but I corrected the php anyway…