# POST isn't passing vars right? Flash, PHP, & MySQL

**URL:** <https://forum.kirupa.com/t/post-isnt-passing-vars-right-flash-php-mysql/294049>\
**Category:** flash\
**Created:** [August 7, 2009, 2:44pm UTC](https://forum.kirupa.com/t/post-isnt-passing-vars-right-flash-php-mysql/294049 "2009-08-07T14:44:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alex\_Stanfill](https://avatars.discourse-cdn.com/v4/letter/a/dec6dc/32.png) [@Alex\_Stanfill](https://forum.kirupa.com/u/Alex_Stanfill)\
**Post date:** [August 7, 2009, 2:44pm UTC](https://forum.kirupa.com/t/post-isnt-passing-vars-right-flash-php-mysql/294049/1 "2009-08-07T14:44:00Z")

</div>

I’ve been working on this one for days 😕

I have a basic login script that I’m working on using Flash, PHP, and MySQL.

I pass two variables (playerusername and playerpassword) to a PHP script that checks for them in my MySQL database:

```auto
<?php
 
$playerusername=$_POST['playerusername'];
$playerpassword=$_POST['playerpassword'];
 
if ($playerusername && $playerpassword){
    mysql_pconnect("localhost","xxxxx","xxxxx");
    mysql_select_db("xxxxx");
    $query = "SELECT * FROM auth WHERE username = '".$playerusername."' AND password = '".$playerpassword."'";
 
    $result = mysql_query($query);
 
    $num = mysql_num_rows( $result );
    if ($num == 1){
        print "&checklogin_status=1";
    } else {
        print "&checklogin_status=2";
    }
    mysql_free_result($result);
}
?>

```

I’ve taken out all my debugging for simplicity, and I’ve tried a lot of things, but this is what I’ve boiled it down to.  
A user account that exists in the MySQL DB is ‘test’ with the password ‘test’  
All of my code works if I do $playerusername=‘test’; and $playerpassword=‘test’; instead of using POST to get the variables.  
However, if I type ‘test’ and ‘test’ into the input fields in flash, it won’t work.  
I even tried printing the variables out after using POST to get them, and they ARE ‘test’ and ‘test’!

Try it yourself: [http://visualtrauma.com/nvp](http://visualtrauma.com/nvp)  
Click play  
username: test  
password: test  
IF IT GOES TO A BLANK SCREEN, login was successful

Any ideas? 😕

Thanks for your time 🙂 Any help is appreciated!
