JasperHope Posted April 21, 2010 Share Posted April 21, 2010 I'm giving PHP a variable with Actionscript. I have Flash buttons setting a variable so PHP can tell HTML to load a file in an object. Here's my code which doesn't work: <?php <object id="foo" name="foo" type="text/html" data=$_POST['flashvariable'] height="700" width="580"></object> ?> Can anyone tell me how this would be done correctly? Cheers. ps. here's my Actionscript code if anyone is interested. I don't know if it will work yet because I can't test it (PHP not working). homebtn.onRelease = function () { myObject.menuvar = "blog.txt"; }; cafebtn.onRelease = function () { myObject.menuvar = "cafe.txt"; }; cateringbtn.onRelease = function () { myObject.menuvar = "catering.txt"; }; privatebtn.onRelease = function () { myObject.menuvar = "private.txt"; }; contactbtn.onRelease = function () { myObject.menuvar = "contact.txt"; }; eventsbtn.onRelease = function () { myObject.menuvar = "events.txt"; }; linksbtn.onRelease = function () { myObject.menuvar = "links.txt"; }; var myObject = new Object(); myObject.menuvar = "blog.txt" var myFalcon:Falcon=new Falcon("index.php", Falcon.VARIABLES, myObject); Quote Link to comment https://forums.phpfreaks.com/topic/199262-php-variable-simple-question/ Share on other sites More sharing options...
MatthewJ Posted April 21, 2010 Share Posted April 21, 2010 You may want to read a basic php tutorial echo '<object id="foo" name="foo" type="text/html" data="'.$_POST['flashvariable'].'" height="700" width="580"></object>'; Quote Link to comment https://forums.phpfreaks.com/topic/199262-php-variable-simple-question/#findComment-1045843 Share on other sites More sharing options...
JonnoTheDev Posted April 21, 2010 Share Posted April 21, 2010 <?php $x = "<object id=\"foo\" name=\"foo\" type=\"text/html\" data=".$_POST['flashvariable']." height=\"700\" width=\"580\"></object>"; print $x; ?> Quote Link to comment https://forums.phpfreaks.com/topic/199262-php-variable-simple-question/#findComment-1045844 Share on other sites More sharing options...
JasperHope Posted April 21, 2010 Author Share Posted April 21, 2010 That's great, thanks a lot. Should I stick all of my code in the echo or can it be anywhere in the PHP file? I tried the code but it seems to hide everthing else (which isn't in the <?php ?>). Quote Link to comment https://forums.phpfreaks.com/topic/199262-php-variable-simple-question/#findComment-1045853 Share on other sites More sharing options...
seventheyejosh Posted April 21, 2010 Share Posted April 21, 2010 You have to echo or print it out for it to be outputted. Or put it outside of the php tags. Quote Link to comment https://forums.phpfreaks.com/topic/199262-php-variable-simple-question/#findComment-1045857 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.