I wondered if anyone has come across this problem,
I created a .fla that resembles an htaccess login popup, but im doing mysql based authentication. I then wrote a PHP script that does the processing.
PHP Code...
<?php
require("globals.php");
// Connect to the database
if (!($link = mysql_connect("$hostName","$userName","$password"))) {
$errMsg = "Could not connect to $hostName";
return $errMsg;
}
// select the database
if (!mysql_select_db ($databaseName, $link)){
$errMsg = "Error in selecting database, $databaseName";
return $errMsg;
}
// execute the statement
$statement = "SELECT * FROM server WHERE userName = \"$user\";";
$result = mysql_query($statement,$link);
if (!$result) {
$errMsg = "Error in executing $statement";
return $errMsg;
}
$row = mysql_fetch_array($result);
$newpassword = crypt($passwrd,zz);
if ($row[0] == $newpassword) {
// {&} - closes the output buffer to the flash, can't evaluate Check in Flash until its closed!
print "&Check=accepted&";
} else {
print "&Check=denied&";
}
mysql_close($link);
exit();
?>
basics of .fla
// this code is on the "OK" button.
on (release) {
Status = "Checking Login Information...";
link = loadVariablesNum ("manager_login.php?user="+userName+"&passwrd="+pass, 0, "POST");
void(link);
gotoAndPlay (2);
}