Re: [Flashcoders] LoadVars.sendAndLoad with POST
This just gets weirder and weirder. Based on a few pages found in google with people having the same issue, I tried switching out sendAndLoad() with send(), and the data gets posted. Switch it back to sendAndLoad() and it fails. I've reduced this code to the simplest possible, in the PHP and the AS including a new swf with nothing more than the code below on frame 1. There are still no variables in POST -- firebug shows them empty. I've also created a simple HTML page and posted to testing.php, and this works fine. Has anyone seen this before? I've been through quite a few pages listing this same problem, and none of those forums/pages has a solution. Example at: http://aut0poietic.us/quiz/sendloadtest.html ActionScript: var _send_lv = new LoadVars() ; var _result_lv = new LoadVars() ; _send_lv.pleasePost = Bite Me ; var result = _send_lv.sendAndLoad(testing.php, _result_lv) ; PHP (testing.php) print(POST\n) ; print_r($_POST) ; print(GET\n); print_r($_GET) ; response (from firebug) POSTArray ( ) GET Array ( ) ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] LoadVars.sendAndLoad with POST
Hi Jer I just tried your page in IE / Windows and using Fiddler saw the following result: 4 POST a Array ( 35 [helpme] = this must work somehow ) GET Array ( ) 0 Seems like it's working? Hope that's of some help (or at least doesn't add to your woes!) Jake On 11/04/07, Jer Brand [EMAIL PROTECTED] wrote: This just gets weirder and weirder. Based on a few pages found in google with people having the same issue, I tried switching out sendAndLoad() with send(), and the data gets posted. Switch it back to sendAndLoad() and it fails. I've reduced this code to the simplest possible, in the PHP and the AS including a new swf with nothing more than the code below on frame 1. There are still no variables in POST -- firebug shows them empty. I've also created a simple HTML page and posted to testing.php, and this works fine. Has anyone seen this before? I've been through quite a few pages listing this same problem, and none of those forums/pages has a solution. Example at: http://aut0poietic.us/quiz/sendloadtest.html ActionScript: var _send_lv = new LoadVars() ; var _result_lv = new LoadVars() ; _send_lv.pleasePost = Bite Me ; var result = _send_lv.sendAndLoad(testing.php, _result_lv) ; PHP (testing.php) print(POST\n) ; print_r($_POST) ; print(GET\n); print_r($_GET) ; response (from firebug) POSTArray ( ) GET Array ( ) ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] LoadVars.sendAndLoad with POST
you are sending an empty loadvars object... returning an empty post array when doing so is a feature, not a bug :) _send_lv.sendAndLoad(testing.php, _send_lv, post); Am 11.04.2007 um 16:59 schrieb Jer Brand: This just gets weirder and weirder. Based on a few pages found in google with people having the same issue, I tried switching out sendAndLoad() with send(), and the data gets posted. Switch it back to sendAndLoad() and it fails. I've reduced this code to the simplest possible, in the PHP and the AS including a new swf with nothing more than the code below on frame 1. There are still no variables in POST -- firebug shows them empty. I've also created a simple HTML page and posted to testing.php, and this works fine. Has anyone seen this before? I've been through quite a few pages listing this same problem, and none of those forums/pages has a solution. Example at: http://aut0poietic.us/quiz/sendloadtest.html ActionScript: var _send_lv = new LoadVars() ; var _result_lv = new LoadVars() ; _send_lv.pleasePost = Bite Me ; var result = _send_lv.sendAndLoad(testing.php, _result_lv) ; PHP (testing.php) print(POST\n) ; print_r($_POST) ; print(GET\n); print_r($_GET) ; response (from firebug) POSTArray ( ) GET Array ( ) ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com bitrocker typographique Lars Schwarz Gottorpstrasse 20 26122 Oldenburg T +49(0)441 2171 354 0 F +49(0)441 2171 354 2 M [EMAIL PROTECTED] W www.bitrocker.com W www.typographique.de ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] LoadVars.sendAndLoad with POST
On 4/11/07, Lars Schwarz [EMAIL PROTECTED] wrote: you are sending an empty loadvars object... returning an empty post array when doing so is a feature, not a bug :) _send_lv.sendAndLoad(testing.php, _send_lv, post); No, _send_lv.sendAndLoad(testing.php, _result_lv) will send _send_lv, not _result_lv. I'm not sure what the result variable is supposed to be, and there are no handlers defined for doing something when it loads, but, other than that, it looks okay. Am 11.04.2007 um 16:59 schrieb Jer Brand: This just gets weirder and weirder. Based on a few pages found in google with people having the same issue, I tried switching out sendAndLoad() with send(), and the data gets posted. Switch it back to sendAndLoad() and it fails. I've reduced this code to the simplest possible, in the PHP and the AS including a new swf with nothing more than the code below on frame 1. There are still no variables in POST -- firebug shows them empty. I've also created a simple HTML page and posted to testing.php, and this works fine. Has anyone seen this before? I've been through quite a few pages listing this same problem, and none of those forums/pages has a solution. Example at: http://aut0poietic.us/quiz/sendloadtest.html ActionScript: var _send_lv = new LoadVars() ; var _result_lv = new LoadVars() ; _send_lv.pleasePost = Bite Me ; var result = _send_lv.sendAndLoad(testing.php, _result_lv) ; PHP (testing.php) print(POST\n) ; print_r($_POST) ; print(GET\n); print_r($_GET) ; response (from firebug) POSTArray ( ) GET Array ( ) ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] LoadVars.sendAndLoad with POST
ooops, sorry, my fault. 2nd par is the target, not the source, right Am 11.04.2007 um 17:51 schrieb T. Michael Keesey: On 4/11/07, Lars Schwarz [EMAIL PROTECTED] wrote: you are sending an empty loadvars object... returning an empty post array when doing so is a feature, not a bug :) _send_lv.sendAndLoad(testing.php, _send_lv, post); No, _send_lv.sendAndLoad(testing.php, _result_lv) will send _send_lv, not _result_lv. I'm not sure what the result variable is supposed to be, and there are no handlers defined for doing something when it loads, but, other than that, it looks okay. Am 11.04.2007 um 16:59 schrieb Jer Brand: This just gets weirder and weirder. Based on a few pages found in google with people having the same issue, I tried switching out sendAndLoad() with send(), and the data gets posted. Switch it back to sendAndLoad() and it fails. I've reduced this code to the simplest possible, in the PHP and the AS including a new swf with nothing more than the code below on frame 1. There are still no variables in POST -- firebug shows them empty. I've also created a simple HTML page and posted to testing.php, and this works fine. Has anyone seen this before? I've been through quite a few pages listing this same problem, and none of those forums/pages has a solution. Example at: http://aut0poietic.us/quiz/sendloadtest.html ActionScript: var _send_lv = new LoadVars() ; var _result_lv = new LoadVars() ; _send_lv.pleasePost = Bite Me ; var result = _send_lv.sendAndLoad(testing.php, _result_lv) ; PHP (testing.php) print(POST\n) ; print_r($_POST) ; print(GET\n); print_r($_GET) ; response (from firebug) POSTArray ( ) GET Array ( ) ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com bitrocker typographique Lars Schwarz Gottorpstrasse 20 26122 Oldenburg T +49(0)441 2171 354 0 F +49(0)441 2171 354 2 M [EMAIL PROTECTED] W www.bitrocker.com W www.typographique.de ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] LoadVars.sendAndLoad with POST
Ugh, it's working, but this whole situation, and the solution, makes no sense. I started testing this with ethereal to monitor the requests, and a combination of ethereal and the server logs showed some pretty odd behavior. Ethereal and IE/FF showed a POST request for the testing.php, with the pleasePost=Bite%20Me. Firebug showed empty post variables. Ethereal and IE/FF showed a POST response from the testing.php, with the Array ( [pleasePost] - Bite Me. Firebug showed Array (). Adding in code to return a variable to flash from php, and the actionscript to handle _result_lv.onLoad() still resulted in no data in _result_lv. But implementing _result_lv.onData() output the correct unparsed data. About this time the admin let me know that for some strange reason, every POST request from flash to testing.php was followed by a GET request to testing.php with no parameters. Also there was a 404 response to a request for favicon.ico, which has nothing to do with anything, but it's there. Admin tried the same thing, and was not getting the second GET request, nor the request for the favicon.ico. Coworker in the same office was getting same result as I was using firefox/firebug. I'm at a complete loss for an explanation, but it's working. I'm not sure whether to blame firebug, firefox, or something else entirely, like my crappy machine here. I'd still kill to know what the heck was going on, but I'm betting I'm going to have to chalk this one up to sunspots, the boogey man or weird crap I make flash do when coding sloppily. Thanks for everyone's help. I'm going to go hide and pretend I didn't waste 8 dev hours on this : X ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] LoadVars.sendAndLoad with POST
Hi, Are you using mod_rewrite at all? We have often encountered empty post's when trying to rewrite php URL's with pretty ones. Just a thought. Glen Jer Brand wrote: I feel like I'm losing my mind here with this error: I've been hitting the archives and google repeatedly, and not having any luck with a solution. I'm trying to use sendAndLoad(..., ..., POST) and having no luck. GET seems to work, but not POST. I've been viewing the results with FlashBug to trace into FireBug, and the POST variables simply aren't there. I can see that the sendAndLoad(...) is running, the page is being requested, simply with no post. PHP also says that $_POST is an empty Array. Tried this from multiple machines, multiple times. This code originally worked until I started writing the sql queries in the PHP, but as you can see I've since removed them, so I'm guessing it had nothing to do with that (and I can't see how it would). I originally worried that it might have something to do with the Serializer, but that doesn't seem to be the problem. I've snipped a bit of code out to clarify the problem, and hope it doesn't make this more difficult. I'm sure this is something extremely simple/stupid on my part, but I'm at that point of beating my head repeatedly on the desk. Anyone able to help out? ActionScript: class LMSComm { private var _send_lv:LoadVars = undefined ; private var _result_lv:LoadVars = undefined ; private var _serializer:Serializer = undefined ; public function LMSComm(config:ReportConfig) { _serializer = new Serializer() ; } public function getUserData(user_id:String, course_id:String):Void { var phpvars:Array = new Array() phpvars[type] = userDataRequest ; phpvars[lms_user_id] = user_id ; phpvars[lms_course_id] = course_id ; var d = new Date() ; phpvars[lms_no_cache] = d.valueOf() ; _send_lv = new LoadVars() ; _result_lv = new LoadVars() ; _result_lv.onLoad = Delegate.create(this, notifyUserDataRecieved) ; var serialized:String = _serializer.serialize(phpvars) ; _send_lv.pos = Bite Me ; _send_lv.courseData = ?+serialized ; Log.trace(CourseData Raw: + _send_lv.courseData) ; // this line runs (as seen in firebug) but is not sending any POST data _send_lv.sendAndLoad(userinfo.php, _result_lv, POST) ; } public function notifyUserDataRecieved(success:Boolean):Void { if(success) { Log.trace(UserData Raw: + _result_lv.userData) ; var userData = _serializer.unserialize(_result_lv.userData) ; // } } PHP Code header(Cache-Control: no-store, no-cache, must-revalidate); header(Cache-Control: post-check=0, pre-check=0, false); header(Pragma: no-cache); error_reporting(E_ALL); $courseData = $_POST['courseData']; if(get_magic_quotes_gpc()) { $courseData = stripslashes($courseData) ; } $courseData = unserialize(urldecode($courseData)); print $courseData[type]; print_r($_POST) ; FIREBUG Console (results of Log.trace()) CourseData Raw: ?a:4:{s:12:lms_no_cache;i:1176240332114;s:13:lms_course_id;s:4:C063;s:11:lms_user_id;s:6:JBRAND;s:4:type;s:15:userDataRequest;} UserData Raw:undefined PHP Output (response in firebug for userinfo.php) br / bNotice/b: Undefined index: courseData in b/var/www/html/devlms/courses/test/quiz/userinfo.php /b on line b8/bbr / Array ( ) Firebug shows no POST variables. ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] LoadVars.sendAndLoad with POST
Tried to kill all that header stuff and simple print_r or echo $_POST['data'] after sending your loadvars. Dont take me wrong, go step by step forward. dr.ache Jer Brand schrieb: I feel like I'm losing my mind here with this error: I've been hitting the archives and google repeatedly, and not having any luck with a solution. I'm trying to use sendAndLoad(..., ..., POST) and having no luck. GET seems to work, but not POST. I've been viewing the results with FlashBug to trace into FireBug, and the POST variables simply aren't there. I can see that the sendAndLoad(...) is running, the page is being requested, simply with no post. PHP also says that $_POST is an empty Array. Tried this from multiple machines, multiple times. This code originally worked until I started writing the sql queries in the PHP, but as you can see I've since removed them, so I'm guessing it had nothing to do with that (and I can't see how it would). I originally worried that it might have something to do with the Serializer, but that doesn't seem to be the problem. I've snipped a bit of code out to clarify the problem, and hope it doesn't make this more difficult. I'm sure this is something extremely simple/stupid on my part, but I'm at that point of beating my head repeatedly on the desk. Anyone able to help out? ActionScript: class LMSComm { private var _send_lv:LoadVars = undefined ; private var _result_lv:LoadVars = undefined ; private var _serializer:Serializer = undefined ; public function LMSComm(config:ReportConfig) { _serializer = new Serializer() ; } public function getUserData(user_id:String, course_id:String):Void { var phpvars:Array = new Array() phpvars[type] = userDataRequest ; phpvars[lms_user_id] = user_id ; phpvars[lms_course_id] = course_id ; var d = new Date() ; phpvars[lms_no_cache] = d.valueOf() ; _send_lv = new LoadVars() ; _result_lv = new LoadVars() ; _result_lv.onLoad = Delegate.create(this, notifyUserDataRecieved) ; var serialized:String = _serializer.serialize(phpvars) ; _send_lv.pos = Bite Me ; _send_lv.courseData = ?+serialized ; Log.trace(CourseData Raw: + _send_lv.courseData) ; // this line runs (as seen in firebug) but is not sending any POST data _send_lv.sendAndLoad(userinfo.php, _result_lv, POST) ; } public function notifyUserDataRecieved(success:Boolean):Void { if(success) { Log.trace(UserData Raw: + _result_lv.userData) ; var userData = _serializer.unserialize(_result_lv.userData) ; // } } PHP Code header(Cache-Control: no-store, no-cache, must-revalidate); header(Cache-Control: post-check=0, pre-check=0, false); header(Pragma: no-cache); error_reporting(E_ALL); $courseData = $_POST['courseData']; if(get_magic_quotes_gpc()) { $courseData = stripslashes($courseData) ; } $courseData = unserialize(urldecode($courseData)); print $courseData[type]; print_r($_POST) ; FIREBUG Console (results of Log.trace()) CourseData Raw: ?a:4:{s:12:lms_no_cache;i:1176240332114;s:13:lms_course_id;s:4:C063;s:11:lms_user_id;s:6:JBRAND;s:4:type;s:15:userDataRequest;} UserData Raw:undefined PHP Output (response in firebug for userinfo.php) br / bNotice/b: Undefined index: courseData in b/var/www/html/devlms/courses/test/quiz/userinfo.php /b on line b8/bbr / Array ( ) Firebug shows no POST variables. ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] LoadVars.sendAndLoad with POST
Hey Glen, I'm pretty sure we're not -- least it's not in use anywhere in our server. I'm going to walk away from this for a while and play some paper mario ;-), but will check in the morning. If the server happens we have mod_rewrite running, how do you overcome the issue? I can say that there is no situation where this folder should be a part of a rule for mod_rewrite. It dawns on me as I write this that the only other change I made between working and not working was to add an event listener to that LMSComm class instance. I can't see where that'd break my loadvars, but I'll check that as well. Jer Glen Pike wrote: Hi, Are you using mod_rewrite at all? We have often encountered empty post's when trying to rewrite php URL's with pretty ones. Just a thought. Glen Jer Brand wrote: I feel like I'm losing my mind here with this error: I've been hitting the archives and google repeatedly, and not having any luck with a solution. I'm trying to use sendAndLoad(..., ..., POST) and having no luck. GET seems to work, but not POST. I've been viewing the results with FlashBug to trace into FireBug, and the POST variables simply aren't there. I can see that the sendAndLoad(...) is running, the page is being requested, simply with no post. PHP also says that $_POST is an empty Array. Tried this from multiple machines, multiple times. This code originally worked until I started writing the sql queries in the PHP, but as you can see I've since removed them, so I'm guessing it had nothing to do with that (and I can't see how it would). I originally worried that it might have something to do with the Serializer, but that doesn't seem to be the problem. I've snipped a bit of code out to clarify the problem, and hope it doesn't make this more difficult. I'm sure this is something extremely simple/stupid on my part, but I'm at that point of beating my head repeatedly on the desk. Anyone able to help out? ActionScript: class LMSComm { private var _send_lv:LoadVars = undefined ; private var _result_lv:LoadVars = undefined ; private var _serializer:Serializer = undefined ; public function LMSComm(config:ReportConfig) { _serializer = new Serializer() ; } public function getUserData(user_id:String, course_id:String):Void { var phpvars:Array = new Array() phpvars[type] = userDataRequest ; phpvars[lms_user_id] = user_id ; phpvars[lms_course_id] = course_id ; var d = new Date() ; phpvars[lms_no_cache] = d.valueOf() ; _send_lv = new LoadVars() ; _result_lv = new LoadVars() ; _result_lv.onLoad = Delegate.create(this, notifyUserDataRecieved) ; var serialized:String = _serializer.serialize(phpvars) ; _send_lv.pos = Bite Me ; _send_lv.courseData = ?+serialized ; Log.trace(CourseData Raw: + _send_lv.courseData) ; // this line runs (as seen in firebug) but is not sending any POST data _send_lv.sendAndLoad(userinfo.php, _result_lv, POST) ; } public function notifyUserDataRecieved(success:Boolean):Void { if(success) { Log.trace(UserData Raw: + _result_lv.userData) ; var userData = _serializer.unserialize(_result_lv.userData) ; // } } PHP Code header(Cache-Control: no-store, no-cache, must-revalidate); header(Cache-Control: post-check=0, pre-check=0, false); header(Pragma: no-cache); error_reporting(E_ALL); $courseData = $_POST['courseData']; if(get_magic_quotes_gpc()) { $courseData = stripslashes($courseData) ; } $courseData = unserialize(urldecode($courseData)); print $courseData[type]; print_r($_POST) ; FIREBUG Console (results of Log.trace()) CourseData Raw: ?a:4:{s:12:lms_no_cache;i:1176240332114;s:13:lms_course_id;s:4:C063;s:11:lms_user_id;s:6:JBRAND;s:4:type;s:15:userDataRequest;} UserData Raw:undefined PHP Output (response in firebug for userinfo.php) br / bNotice/b: Undefined index: courseData in b/var/www/html/devlms/courses/test/quiz/userinfo.php /b on line b8/bbr / Array ( ) Firebug shows no POST variables. ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your