nathanleyton
07-07-2003, 04:30 PM
Why is flash not sending the varibles to PHP.
I have 2 input text boxes on Level0 with 2 variable names
usernamesend
passwordsend
I have a button with this on it
on (release, keyPress "<Enter>") {
if (usernamesend == null) {
message = "Please Insert Username & Password";
gotoAndPlay(_currentframe-1);
} else {
loadVariablesNum("http://localhost/OnlineStats/login.php", 0, "POST");
message = "testing";
}
}
the message goes to testing... it retries data from my PHP script but it hasn't sent the variables I know this becuase PHP is sending back messages to my message variable to tell what is happening and when.
Ill post my PHP just so you can see.
<?php
$myServer = "MYSERVER";
$myUser = "MYUSER";
$myPass = "MYPASSWORD";
$myDB = "MYDB";
$s = mssql_connect($myServer, $myUser, $myPass)
or die("Couldn't connect to SQL Server on $myServer");
$d = mssql_select_db($myDB, $s)
or die("Couldn't open database $myDB");
$query = "SELECT * FROM OnlineStatsLogin WHERE username = '$usernamesend'";
$result = mssql_query($query);
$numRows = mssql_num_rows($result);
if ($numRows == null){
print "&message=no rows found";}
else
{$username = mssql_result($result,0,"username");
$password = mssql_result($result,0,"password");
if ($password == $passwordsend and $username == $usernamesend)
{$message = 'Authenticated';}
else
{$message = 'Failed';}
if ($passwordsend == null)
{$message = 'please insert username and password';}
print "&message=$message";
}
?>
Thanks for reading..
NAthan
I have 2 input text boxes on Level0 with 2 variable names
usernamesend
passwordsend
I have a button with this on it
on (release, keyPress "<Enter>") {
if (usernamesend == null) {
message = "Please Insert Username & Password";
gotoAndPlay(_currentframe-1);
} else {
loadVariablesNum("http://localhost/OnlineStats/login.php", 0, "POST");
message = "testing";
}
}
the message goes to testing... it retries data from my PHP script but it hasn't sent the variables I know this becuase PHP is sending back messages to my message variable to tell what is happening and when.
Ill post my PHP just so you can see.
<?php
$myServer = "MYSERVER";
$myUser = "MYUSER";
$myPass = "MYPASSWORD";
$myDB = "MYDB";
$s = mssql_connect($myServer, $myUser, $myPass)
or die("Couldn't connect to SQL Server on $myServer");
$d = mssql_select_db($myDB, $s)
or die("Couldn't open database $myDB");
$query = "SELECT * FROM OnlineStatsLogin WHERE username = '$usernamesend'";
$result = mssql_query($query);
$numRows = mssql_num_rows($result);
if ($numRows == null){
print "&message=no rows found";}
else
{$username = mssql_result($result,0,"username");
$password = mssql_result($result,0,"password");
if ($password == $passwordsend and $username == $usernamesend)
{$message = 'Authenticated';}
else
{$message = 'Failed';}
if ($passwordsend == null)
{$message = 'please insert username and password';}
print "&message=$message";
}
?>
Thanks for reading..
NAthan