请帮我解决这个问题,我做错了什么?我正在尝试创建一个登录系统并连接我的 MySQL 数据库:再次尝试将我的 MySQL 数据库与此登录系统连接。登录系统将在 Flash 中完成。谢谢大家 :)
<?php
$dbhost = "databasehost";
$dbname = "users";
$dbuser = "users";
$dbpass = "pass";
//Connect to database
mysql_connect ( $dbhost, $dbuser, $dbpass)or die("Could not connect: ".mysql_error());
mysql_select_db($dbname) or die(mysql_error());
// The response variable
$res = "res=KO";
// Check incoming data
if ($_POST['$dbuser'] != "" && $_POST['$dbpass'] != "")
{
foreach($allowedUsers as $dbname => $dbpass)
{
if ($_POST['$dbuser'] == $name && $_POST['$dbpass'] == $password)
{
// Ok, user found
$res = "res=OK";
break;
}
}
}
print $res;
?>