3 Replies Latest reply on Aug 11, 2010 6:40 AM by kglad

    Checking TWO variables in PHP file

    mach6ix

      Hello and thank you in advance for any helpy you can provide.

       

      We have a FLASH website that uses PHP to authenticate users.

       

      We have recenlty been asked to impliment TWO variables as we used to only have one.

       

      Here's what our php returns when request the URL www.mywebsite.com/newlogin.php:


      checkLog=200&nationality=US

       

      Here is our AS2 code:


      loadVariablesNum("../newlogin.php", 0, "POST");

       

      this.onEnterFrame = function ()

       

      {  
          if(nationality != "US")
          {
              _root.gotoAndStop("denied");
              delete this.onEnterFrame;
          }
         
          if(_root.checkLog == 100)
          {
              _root.gotoAndStop("perlick_reg");
              delete this.onEnterFrame;
          }
          if(_root.checkLog == 200)
          {
              _root.gotoAndStop("perlick_part");
              delete this.onEnterFrame;
          }
          if(_root.checkLog == 999)
          {
              _root.gotoAndStop("denied");
              delete this.onEnterFrame;
          }
      }

       

      When we try to enter our Flash site, we always get directed to the "denied" frame.  Please help.  Is our php spitting out two variables the wrong way or are we checking in Flash incorrectly?

       

      Thanks again.

        • 1. Re: Checking TWO variables in PHP file
          kglad Adobe Community Professional & MVP

          use the trace() function to confirm the anticipated variable/values are returned.  also, check their length to confirm white space is not an issue.  finally, change your test for checkLog from a number to a string:

           



          loadVariablesNum("../newlogin.php", 0, "POST");

           

          this.onEnterFrame = function ()

           

          {  
              if(nationality != "US")
              {
                  _root.gotoAndStop("denied");
                  delete this.onEnterFrame;
              }
             
              if(_root.checkLog == "100")
              {
                  _root.gotoAndStop("perlick_reg");
                  delete this.onEnterFrame;
              }
              if(_root.checkLog == "200")
              {
                  _root.gotoAndStop("perlick_part");
                  delete this.onEnterFrame;
              }
              if(_root.checkLog == "999")
              {
                  _root.gotoAndStop("denied");
                  delete this.onEnterFrame;
              }
          }


           

          or, you might want to change your code first to check for a string because that's a certain error that needs to be fixed.  the other two checks are for other possible issues.

          • 2. Re: Checking TWO variables in PHP file
            mach6ix Level 1

            Thanks K-Glad.

             

            Through your notes, we have been able to troubleshoot our issue to

            resolution.

             

            Thanks

             

            Michael Bowyer

            Technical Support Analyst

            Bevinco Global Office

            Tel: (416) 490-6266 ext 250

            Emergency Support Tel: (647) 309-TECH (8324)

            • 3. Re: Checking TWO variables in PHP file
              kglad Adobe Community Professional & MVP

              you're welcome.

               

              please mark this thread as answered, if you can.