PDA

View Full Version : Php <? H E L P ?>



djozusa
April 22nd, 2003, 05:29 PM
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.

Jubba
April 22nd, 2003, 07:41 PM
so what exactly are you trying to do? load the variables into Flash? I'm still a little unclear what you are attempting...

ahmed
April 22nd, 2003, 07:44 PM
I dont think swf files can LOAD variables through this method ("GET"). I haven't came accross anything like this before. :)

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

djozusa
April 22nd, 2003, 10:11 PM
Jubba -

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

Jubba
April 22nd, 2003, 10:40 PM
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.

ahmed
April 22nd, 2003, 10:50 PM
Jubba-
can you feed an swf the variables through this method:q:

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

Jubba
April 23rd, 2003, 09:55 AM
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...

ahmed
April 23rd, 2003, 11:15 AM
oh.. i thought so too.. but i kinda misunderstood what they're trying to do :)

Jubba
April 23rd, 2003, 11:24 AM
yeah me too... :) I still don't fully understand but I corrected the php anyway...