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:
<?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
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!