2 Replies Latest reply on Sep 15, 2009 10:16 AM by jsoldi

    URLRequestMethod.POST not working?

    jsoldi

      I got the following super simple code on my Flex app:

       

      private function OnButtonClick():void

      {

           var request:URLRequest = new URLRequest("http://juaneco.webatu.com/index.php");

           request.contentType = "text/xml";

           request.data = "hello";

           request.method = URLRequestMethod.POST;               // POST Right here!

           var loader:URLLoader = new URLLoader(request);

           loader.load(request);

      }

       

      and this is my php code (after conecting to database and all that):

       

      foreach ($_POST as $varname => $varvalue) {

           $query = "INSERT INTO  `a4510541_data`.`prueba` (".

           "`id` ,".

           "`varname` ,".

           "`varvalue`".

           ")".

           "VALUES (".

           "NULL ,  'POST: ".$varname."',  '".$varvalue."'".          // POST Right here!

           ");";

           mysql_query($query);

      }

       

      The thing is that when I replace POST for GET on both lines where the "POST Right here!" comment is, everything works fine, my database get fed by my Flex app, but nothing at all happens when I use POST instead. Am I missing something?