本文整理汇总了PHP中xajaxResponse::Script方法的典型用法代码示例。如果您正苦于以下问题:PHP xajaxResponse::Script方法的具体用法?PHP xajaxResponse::Script怎么用?PHP xajaxResponse::Script使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xajaxResponse
的用法示例。
在下文中一共展示了xajaxResponse::Script方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: login
function login($data)
{
//global $tpl;
$objResponse = new xajaxResponse();
include 'settings/tables.php';
/* Crypt Password with MD5 Method */
$pw_crypted = MD5(mysql_real_escape_string($data['password']));
//encrypt password with MD5
$email = mysql_real_escape_string($data['email']);
/******************************************/
/* Create Object :: EXIST */
$logon = new CheckExist();
/******************************************/
/* Check :: EXIST */
$logon->tableE = $tbl_users;
$logon->conditionE = " UserEmail = '" . $email . "' && UserPass = '" . $pw_crypted . "' && activation_code = '' ";
$CheckData = $logon->exist();
/******************************************/
/* Change Status :: Login successful or failed */
if ($CheckData == 1) {
$logon->email = $email;
$logon->pw = $pw_crypted;
$logon->tbl_users = $tbl_users;
//setcookie
if (isset($data['autologon'])) {
$logon->cookie_duration = 1;
} else {
$logon->cookie_duration = 0;
}
$logon->cookieset('ly');
$objResponse->Script("document.getElementById('submit_login').onclick()");
$objResponse->redirect(ROOT_DIR);
//return true;
} else {
$logon->email = '';
$logon->pw = '';
//$logon->cookieset('l');
$objResponse->assign("p_logon_failure", "style.display", 'block');
$objResponse->assign("p_logon_failure", "innerHTML", "Login information could not be verified.<br> Please try it again.");
//TODO move string to language file
//$tpl->display("logon/login.tpl");
//return false;
}
unset($logon);
/******************************************/
return $objResponse;
}