Onbekend |
|
Ik heb nu een inlog systeem in mijn spel, hoe laat ik nu de gegevens laden in een tekstvak??
hier is mijn inlog stukje in 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","username","pass") or die ("didn't connect to mysql");
mysql_select_db("dmname") or die ("no database");
//make query
$query = "SELECT * FROM players 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";
}
}
?>
<? //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){ //make query $query = "SELECT * FROM players WHERE username = '$user' AND userpassword = '$pass'"; //see if there's an EXACT match 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"; } } ?>
button event van login
//this will be the action to get your variables from the PHP
on (release, keyPress "<Enter>") {
//checks to see if there is something in both the name
//and password
if (user != "" && pass != "") {
status = "Login, please be patient...";
//if you changed the php file name, change it here to!!
loadVariablesNum("newlogin.php", 0, "POST");
}
}
//this will be the action to get your variables from the PHP on (release, keyPress "<Enter>") { //checks to see if there is something in both the name //and password if (user != "" && pass != "") { status = "Login, please be patient..."; //if you changed the php file name, change it here to!! loadVariablesNum("newlogin.php", 0, "POST"); } }
|