9 Replies Latest reply on Jul 29, 2009 12:08 PM by mach6ix

    loadVariablesNum("...",0,"POST") not POST-ing

    mach6ix Level 1

      Hi everyone,

      I have followed a tutorial found through Kirupa via http://www.kirupa.com/developer/acti...entication.htm

      After completing the tutorial, I found that I am getting an odd error in the "status Variable" window. I have changed the status (status text field) to reflect the SQL statement, as i was not getting the desired response, and it is showing as "SELECT * FROM auth WHERE username =' " (the original query as seen in the PHP is: "SELECT * FROM auth WHERE username='$user' AND userpassword='$pass' ") and cuts off here, so there's a problem with $user having a ' " ' in it, possibly, or nothing at all. From here, I changed it so status would reflect $user and it cut off the remainder of what to show after $user, with nothing in front. (ie. status="s $user s&checkLog=2" would just return "s ")

      So I feel that the info is NOT being sent via POST properly and I'm really at a loss for words on what to say and/or do.

      Thanks for your help in this manner!

        • 1. Re: loadVariablesNum("...",0,"POST") not POST-ing
          kglad Adobe Community Professional & MVP

          use:

           


          "SELECT * FROM auth WHERE username='".$user."' AND userpassword='".$pass."' ";

          • 2. Re: loadVariablesNum("...",0,"POST") not POST-ing
            mach6ix Level 1

            Thanks K-Glad,

             

            However the changes made no difference unforunatly as it responded in exactly the same way.

             

            Cheers,

             

            Mike

            • 3. Re: loadVariablesNum("...",0,"POST") not POST-ing
              mach6ix Level 1

              Thanks K-Glad,

               

              However it appears it's still functioning the same way .

               

              I've attached the files separately below.

               

              Cheers,

               

              Mike

              • 4. Re: loadVariablesNum("...",0,"POST") not POST-ing
                mach6ix Level 1

                It appears my postings are erroring out on me and posting anyways. Sorry for the duplicates.

                 

                I have posted again, to provide attachments, of which did not get attached on my last two postings.

                 

                Cheers,

                 

                Mike

                • 5. Re: loadVariablesNum("...",0,"POST") not POST-ing
                  kglad Adobe Community Professional & MVP

                  clear your cache and retest.

                  • 6. Re: loadVariablesNum("...",0,"POST") not POST-ing
                    mach6ix Level 1

                    I've cleared my cache and found no difference.

                     

                    Have you reviewed the files on your end and found it to be functional...not that i'm insisting, just curious is all.

                     

                    Thanks,

                     

                    Mike

                    • 7. Re: loadVariablesNum("...",0,"POST") not POST-ing
                      kglad Adobe Community Professional & MVP

                      no, i haven't copied your code and tested.

                       

                      if you're seeing the same error as before, you have switched the order of the double quote and single quote in the code i gave above.

                      • 8. Re: loadVariablesNum("...",0,"POST") not POST-ing
                        mach6ix Level 1

                        Hi K-Glad,

                         

                        I had our main programmer review your message however he didn't think it would work.

                         

                        I attempted it and found no difference so I reverted back to the way we had it.

                         

                        I have since reapplied your code and found that it is behaving slightly diffeernetly.

                         

                        Rather than the "Status" window displaying the user name and password entered (which of course wasn't correct...hence our post), I am now finding that it stops at "Begin Login Process...please wait".

                         

                        Of which I belive stems from the actionscript applied to the "Submit" button as shown below.

                         

                        So it's not moving beyond the flash application as it's not even touching base with PHP "newlogin.php" file.

                         

                        Submit Button AS

                         

                        on (release, keyPress "<Enter>") {
                            if (user != "" && pass != "") {
                               
                                status = "Begin Login Process - Wait...";
                                loadVariablesNum("newlogin.php", 0, "POST");
                            }
                        }

                         

                        newlogin.php

                         

                        <?
                        //this pulls the variables from the flash movie when the user
                        //hits submit.  Use this when your global variables are off.
                        //I don't know how to toggle global variables, so I just put
                        //it in all the time
                        $user=$_POST['user'];
                        $pass=$_POST['pass'];

                         

                        //connect to database
                        if ($user && $pass){
                            mysql_pconnect("localhost","root","m2j4v8") or die ("didn't connect to mysql");
                            mysql_select_db("auth") or die ("no database");
                        //make query
                        $query = "SELECT * FROM auth WHERE username='".$user."' AND userpassword='".$pass."' ";
                        $result = mysql_query( $query ) or die ("didn't query");

                         

                        //see if there's an EXACT match
                        $num = mysql_num_rows( $result );
                        if ($num == 1){
                            print "status=You're in&checklog=1";
                            } else {
                            print "status=Sorry, but your user name and password did not match a user name/password combination in our database.  Usernames and passwords are entered in from a different file.  Thank you for visiting test login script!!&checklog=2";
                        }
                        }

                         

                        ?>

                         

                        Thanks Mate,

                         

                        Mike

                        • 9. Re: loadVariablesNum("...",0,"POST") not POST-ing
                          mach6ix Level 1

                          Doh!

                           

                          I found an issue. I think my xammp is a bad install as I have it on a Windows 7 RC machine.

                           

                          I am going to move everything to a laptop I know has worked as a server in the past.

                           

                          Be in touch shortly.

                           

                          Thanks again for your quick and timely respones as you have been extremely helpful.

                           

                          mike