Flash not sending variables to PHP

I have writtin a php script for a flash user login program however when I try to send the username and password vars to my php page, the script echo's "1" which means that the username and/or password are not in the database. I have put in the correct username and password but it will not work for some reason.
The other thing I need to figure out how to do, is have my php page send the number that has been echoed back to my flash document.
For example, if I was banned from the program, php would echo "2", then that number is read by flash and the appropriate action is taken.
Here is my actionscript:

loginBTN.onRelease = function() {
      status = "Loading...please wait..."
      myUser = new LoadVars()
      myUser.username = _root.username.text
      myUser.pwd = _root.pwd.text
      loadVariablesNum("http://www.website.com/scripts/login.php", myUser, "GET")
      myUser.onLoad = function() {
            if (myUser.status == 0) {
                                                gotoAndStop(10)
            }
            if (myUser.status == 1) {
                                                status = "Incorrect uesrname or password"
            }
            if (myUser.status == 2) {
                  status = "BANNED!"
            }
            if (myUser.status == 3) {
                  status = "Double login."
            } else {
                  status = "Error"
            }
      }
}

Here is my php page:

<?php      
      require_once "db_class.inc.php";
      require ('db.php');
      $connect = mysql_connect($dbhost, $dblogin, $dbpass) or die(mysql_error());
      $db_select = mysql_select_db($dbname) or die(mysql_error());
            $ipq = "SELECT ip FROM ip_ban";
            $ipr = mysql_query($ipq) or die(mysql_error());
                  while($iprow = mysql_fetch_assoc($ipr)) {
                        if($iprow["IP"] == $_ENV["REMOTE_ADDR"]) {
                            echo "&result=2&";
                              exit();
                        }
                  }
            $username = $HTTP_GET_VARS['username'];
            $pwd = $HTTP_GET_VARS['pwd'];
            $query = mysql_query("SELECT * FROM users WHERE username= \"$username\" AND password= \"$pwd\" ");
            if (mysql_num_rows($query) > 0) {
                  echo "&result=0&";
            }  else {
                  echo "&result=1&";
            }
?>


Any help would be great.

Cheers

-OBCT
LVL 9
OBCTAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

DILORENZOCommented:
Hello, I think you could try

sendandload("http://www.website.com/scripts/login.php", myUser, "POST")

rather than

loadVariablesNum("http://www.website.com/scripts/login.php", myUser, "GET")

..this is where your passing to the php right. If not I don't see where you are.    Try not to use get with sensitive info or it will be visible.
0
OBCTAuthor Commented:
I tried your suggestion and changed my php to use HTTP_POST_VARS but it still didn't work.
0
OBCTAuthor Commented:
Ok, I managed to get my php script working but I had to use $HTTP_GET_VARS.
I tried returning the php result using trace, but it echo's 1 even if my username and password are correct.
Here is my code

stop()
Selection.setFocus(username)
loginBTN.onRelease = function() {
      this._parent.status = "1st stage complete"
      this._parent.myUser = new LoadVars()
      this._parent.myUser.username = _root.username.text
      this._parent.myUser.password = _root.password.text
      this._parent.myUser.onLoad = function() {
            
            trace(this.result);
            if (this.result == "0") {
           gotoAndStop(10)
            }
            else if (this.result == "1") {
           this._parent.status = "Incorrect uesrname or password"
            }
            else if (this.result == "2") {
                  status = "some value"
            }
            else if (this.result == "3") {
                  status = "ip ban"
            }
      };
      this._parent.myUser.sendAndLoad("http://www.dsfsadfsdfasd.com/scripts/login.php", this._parent.myUser, "GET")
}
0
OBCTAuthor Commented:
Never mind, I got it working :)
Thanks for your help anyway.

Cheers


-OBCT
0
LunchyCommented:
PAQed, with points refunded (500)

Lunchy
Friendly Neighbourhood Community Support Admin
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Flash

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.