jspodisus Posted November 17, 2009 Share Posted November 17, 2009 Hi all, I've got a flash front end for an image gallery. The images are pulled into Flash via php which delivers a string of filepaths - this works fine. Now I need to allow users to delete certain images if they choose so I need to be able to pass a particular filepath to a new php file (delete.php). I have the filepath of the currently displayed image as a variable in flash called "delete_path". QUESTION - how, (on a button trigger with AS2) can I pass this string "delete_path" to delete.php ? WORTH KNOWING - there is tons of other dynamic data on the flash front end and I don't really want to chuck it all at the php file - just the one variable "delete_path". Quote Link to comment https://forums.phpfreaks.com/topic/181863-post-variable-from-flash-to-php/ Share on other sites More sharing options...
MadTechie Posted November 17, 2009 Share Posted November 17, 2009 Your need to pass the parameter via a POST or a GET for example (GET), delete.php?delete_path=123 the PHP would look like this <?php $delete_path = $_GET['delete_path']; //do something with $delete_path for example (POST), the PHP would look like this <?php $delete_path = $_POST['delete_path']; //do something with $delete_path Now my flash skills are.. well not that great! but this should work or at least give you a direction your button would call an AS that would look like this GET var delete_path:string = "123"; getURL("delete.php?delete_path="+delete_path); POST your use LoadVars.send or LoadVars.sendAndLoad LoadVars.send does a POST (or GET) without opening a browser windows or displaying anything to the user. LoadVars.sendAndLoad does the same thing while getting a return value from the target script. userData = new LoadVars(); userData.delete_path = "123"; userData.send("delete.php", 0, "POST"); Hope that helps Quote Link to comment https://forums.phpfreaks.com/topic/181863-post-variable-from-flash-to-php/#findComment-959197 Share on other sites More sharing options...
jspodisus Posted February 4, 2010 Author Share Posted February 4, 2010 ohh that's great i think i got what i have been missing since last days thanks Quote Link to comment https://forums.phpfreaks.com/topic/181863-post-variable-from-flash-to-php/#findComment-1006706 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.