i have this ajax login panel which can be downloaded from http://www.coolajax.net/preview/download/accor/11.html
now i dnt knw how to make it work with my user management system… here is the user login page that i use now… i thought this might help…
[php]<?
require_once(dirname(FILE) . “/globals.php”);
$ffForm = new FfForm();
$ffForm->addField(new UsernameField("user", "Username", REQUIRED));
$ffForm->addField(new EnterPasswordField("pwd", "Password", REQUIRED));
$ffForm->addField(new SubmitField("submit", "Login"));
$ffForm->setEnterTabs(false);
$ffForm->getParameters();
if ($ffForm->getValue("submit")) {
if ($ffForm->checkValues()) {
$user = getSimpleValues(
"SELECT user_id,status from " . SECURE_TABLE_PREFIX . "users "
. "WHERE username=" . $ffForm->getDbValue("user") . " "
. "AND password=MD5(" . $ffForm->getDbValue("pwd") . ")"
);
$userId = $user["user_id"];
if ($userId != null && $user["status"] === "Active") {
login($userId, $ffForm->getValue("user"));
if ($_REQUEST["goTo"]) {
header("Location: " . $_REQUEST["goTo"]);
} else {
// GET 1st start_url
$db = &FfDb::s();
$startUrl = $db->getSimpleValue("
SELECT start_url
FROM " . SECURE_TABLE_PREFIX . "group_members as group_members," . SECURE_TABLE_PREFIX . "groups as groups
WHERE group_members.user_id='" . $userId . "'
AND group_members.group_id=groups.group_id
");
if (!$startUrl)
$startUrl = "user/index.php";
header("Location: " . $startUrl);
}
} else {
$ffForm->clearValue("pwd");
}
}
}
?>
SciCom - Login <? require_once(dirname(__FILE__) . "/section1.php"); ?>
|
pls help…