2 Replies Latest reply on Nov 1, 2009 8:54 AM by 1advent

    httprequest works on local machine, but not server

    1advent

      I created an application to send "survey" info back to a php file:

      <script>

              private function send_data():void {

                  userRequest.send();

              }

      </script>

      calls:

      <script>

          <mx:HTTPService id="userRequest" url="http://www.marketingmetricsmedia.com/playground/healthSurvey.php" useProxy="false" method="POST">

              <mx:request xmlns="">

                  <quest1>{quest1}</quest1>

                  <quest2>{quest2}</quest2>

                  <quest3>{quest3}</quest3>

                  <quest4>{quest4}</quest4>

                  <quest5>{quest5}</quest5>

                  <quest6>{quest6}</quest6>

                  <quest7>{quest7}</quest7>

                  <quest8>{quest8}</quest8>

                  <quest9>{quest9}</quest9>

                  <quest10>{quest10}</quest10>

                  <quest11>{quest11}</quest11>

                  <quest12>{quest12}</quest12>

                  <quest13>{quest13}</quest13>

                  <quest14>{quest14}</quest14>

                  <quest15>{quest15}</quest15>

                  <quest16>{quest16}</quest16>

                  <comments>{Comments.text}</comments>

       

              </mx:request>

          </mx:HTTPService>

      </script>

      and the php page is:

      <script>

      <?php

      $content = " ";

      //$ip = getenv('REMOTE_ADDR'); //~ get ip address

      //$ip = "&ip=".$ip."&"; //~ make it a flashable variable

       

      foreach ($_REQUEST as $key => $value) {

      //$$key = $value;

              //$content .= $value;

       

       

      if ($key != "PHPSESSID" && $key != "logintheme" && $key != "__utma" && $key != "__utmz" && $key != "cprelogin" && $key != "cpsession")

      {

      $content .= "$key";

      $content .= "=";

      $content .= "$value";

      $content .= "~";

      }

       

      }

      //$content .= "ip=";

      //$content .= "$ip";

       

      $Handle = fopen('data.txt', 'a');

      $Data = "\n";

      fwrite($Handle, $Data);

      fwrite($Handle, $content);

      fclose($Handle);

       

       

      ?>

      </script>

       

      This all works from Flex, and from the "bin" but it wont work when i upload it. The survey shows working but it doesnt update the data.txt file.

       

      I'm new to this language, so i'm sorry if this is an easy one. (or if i did something sloppy.)

       

      Josh