phpfreakjav Posted June 5, 2009 Share Posted June 5, 2009 I have a flash movie that sends data to results.php var sender = new LoadVars(); sender.xy = "someVariableValue"; sender.send('http://localhost/crazy_experiments/biomed/results.php', '', 'POST'); The result of this command is that the url in results.php appends to the following http://localhost/crazy_experiments/biomed/results.php?xy=someVariableValue The question: How do I grab the someVariableValue String from the url. Quote Link to comment https://forums.phpfreaks.com/topic/161129-php-grabbing-url-for-string-after-question-mark/ Share on other sites More sharing options...
Alex Posted June 5, 2009 Share Posted June 5, 2009 $variable = $_POST['xy']; Or request if it's coming from the URL.. $variable = $_REQUEST['xy']; Quote Link to comment https://forums.phpfreaks.com/topic/161129-php-grabbing-url-for-string-after-question-mark/#findComment-850260 Share on other sites More sharing options...
phpfreakjav Posted June 5, 2009 Author Share Posted June 5, 2009 I solve the problem! The problem was that I was running the movie as a standalone swf file. When I inserted the movie into html <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="550" height="400" accesskey="1" tabindex="2" title="Mouse"> <param name="movie" value="14.swf"> <param name="quality" value="high"> <embed src="14.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="550" height="400"></embed> </object> The problem was fixed! thanks for making me think! Quote Link to comment https://forums.phpfreaks.com/topic/161129-php-grabbing-url-for-string-after-question-mark/#findComment-850264 Share on other sites More sharing options...
KevinM1 Posted June 5, 2009 Share Posted June 5, 2009 Or request if it's coming from the URL.. $variable = $_REQUEST['xy']; Actually, using $_GET['xy'] is slightly better. Quote Link to comment https://forums.phpfreaks.com/topic/161129-php-grabbing-url-for-string-after-question-mark/#findComment-850268 Share on other sites More sharing options...
phpfreakjav Posted June 5, 2009 Author Share Posted June 5, 2009 Now something unexpected happened. The website seems the reload very often as if it was still communicating with flash. ??? Quote Link to comment https://forums.phpfreaks.com/topic/161129-php-grabbing-url-for-string-after-question-mark/#findComment-850274 Share on other sites More sharing options...
phpfreakjav Posted June 5, 2009 Author Share Posted June 5, 2009 I solved that issue after putting the data into a function call like this : This function shows how to pass an array onclick in flash to php. var testing = new Array(); testing[0]="american explorer"; sData.onRelease = function() { sender.testing = testing[0]; sender.send('http://localhost/crazy_experiments/biomed/results.php','','POST'); } php code is $dataReceived= array($HTTP_POST_VARS["testing"]);//multidimensional array Quote Link to comment https://forums.phpfreaks.com/topic/161129-php-grabbing-url-for-string-after-question-mark/#findComment-850307 Share on other sites More sharing options...
trq Posted June 5, 2009 Share Posted June 5, 2009 That last line should be.... $dataReceived= $_POST["testing"]; $HTTP_POST_VARS has long been depricated, and Im not sure why your adding yet another dimension to the array. Quote Link to comment https://forums.phpfreaks.com/topic/161129-php-grabbing-url-for-string-after-question-mark/#findComment-850311 Share on other sites More sharing options...
dreamwest Posted June 5, 2009 Share Posted June 5, 2009 $variable = $_POST['xy']; Or request if it's coming from the URL.. $variable = $_REQUEST['xy']; Actually , The $_REQUEST function can be used to collect form data sent with both the GET and POST methods. Quote Link to comment https://forums.phpfreaks.com/topic/161129-php-grabbing-url-for-string-after-question-mark/#findComment-850312 Share on other sites More sharing options...
trq Posted June 5, 2009 Share Posted June 5, 2009 $variable = $_POST['xy']; Or request if it's coming from the URL.. $variable = $_REQUEST['xy']; Actually , The $_REQUEST function can be used to collect form data sent with both the GET and POST methods. Yes, but if you know where the data should be it is best to get it directly from there. $_REQUEST can cause security issues. Quote Link to comment https://forums.phpfreaks.com/topic/161129-php-grabbing-url-for-string-after-question-mark/#findComment-850313 Share on other sites More sharing options...
dreamwest Posted June 5, 2009 Share Posted June 5, 2009 Yes, but if you know where the data should be it is best to get it directly from there. $_REQUEST can cause security issues. Just saying request can do all three post, get and cookie. However i never use request Quote Link to comment https://forums.phpfreaks.com/topic/161129-php-grabbing-url-for-string-after-question-mark/#findComment-850319 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.