我正在使用最简单的 Jquery 代码来检查是否向服务器发出请求以检查某些表列并相应地返回 true 或 false ....
$.ajax({
type: "POST",
url: "check_ajax_availablity.php",
data: "user_name=" + user_name,
success: function (server_response) {
alert(server_response);
}
});
我的 PHP 脚本是...
<?php
include 'admin_functions.php';
if (isset($_REQUEST)) {
$user_name = $_REQUEST['user_name'];
$condition = " `UserName` = '" . $user_name . "'";
$result = $oAdmFun->chk_records('login_admin', $condition);
if ($result == TRUE) {
return "N";
} else {
return "Y";
}
}
?>
问题是它的警报空白值......