xlxprophetxlx Posted January 28, 2008 Share Posted January 28, 2008 Hello everyone, I have a little problem. What I am trying to accomplish is sending variables from Flash to PHP. What I need to happen is when I click a button in Flash it will send a variable out to the PH to change the HTML on the page. I tried using a query string...it works but it reloads the page which shouldn't happen. I am trying to avoid using a query string if possible. I was thinking LoadVars would work but I can't seem to get it. Similar to this: PHP index.php page: <?php if ($ruins = "ruins"){ echo "<p>WORKED!!!</p>"; }else{ echo "<p>Doesn't Work</p>"; }; ?> Flash Button: function aboutfunction() { if (_global.sceneframe == "ruins") { _root.loader_mc.loadMovie("aboutus.swf"); var ruins:String = "ruins"; getURL("index.php?ruins="+ruins); } else { startPreload("transition.swf"); _global.sceneframe = "ruins"; var ruins:String = "ruins"; getURL("index.php?ruins="+ruins); } } nav.nav_about.onRelease = aboutfunction; The code above uses a query sting but like I said I would like to avoid using a query string. Any steps in the right direction would be helpful. Thanks, -Mike Quote Link to comment https://forums.phpfreaks.com/topic/88253-php-and-flash-sending-variables/ Share on other sites More sharing options...
trq Posted January 28, 2008 Share Posted January 28, 2008 What I need to happen is when I click a button in Flash it will send a variable out to the PH to change the HTML on the page. I tried using a query string...it works but it reloads the page which shouldn't happen. If you want the html on the page changed it will need to be reloaded. Unless you plan on using some ajax. Otherwise, you are correct, LoadVars will do what you want. Your php is fubar however.... <?php if (isset($_GET['ruins'])) { if ($_GET['ruins'] == "ruins") { echo "<p>WORKED!!!</p>"; } else { echo "<p>Doesn't Work</p>"; } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/88253-php-and-flash-sending-variables/#findComment-451590 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.