[PHP], [FLASH], [MYSQL] - Login Help?

Hey everyone,

i have hosting at media temple and i’m trying to create a login using the kirupa one as a base…for some reason it just won’t login!?

Attached below is my php code:

<?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['username'];
$pass=$_POST['password'];

//connect to database
if ($user && $pass){
    mysql_pconnect('myServer', 'myUserName', 'myPassword');
    mysql_select_db("myDB") or die (mysql_error());
//make query
$query = "SELECT * FROM users WHERE username = '$user' AND password = '$pass'";
$result = mysql_query( $query ) or die (mysql_error());

//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&checklog=2";
}
}

?>

Any ideas what i’m doing wrong if anything in this file? if not i’m guessing my error lies within my flash file…I can post my as code if needed and more details.

Thanks in advance :smiley:
Cheers