本文整理汇总了PHP中msg::set_msg方法的典型用法代码示例。如果您正苦于以下问题:PHP msg::set_msg方法的具体用法?PHP msg::set_msg怎么用?PHP msg::set_msg使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类msg
的用法示例。
在下文中一共展示了msg::set_msg方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: header
}
if ($dbu->anti_sql_injection($_POST['p_uname']) and $dbu->anti_sql_injection($_POST['p_uname'])) {
// lakukan proses login
$passwordhash = md5(serialize($p_pwdx));
$sql = "select *\n\t\t\t\tfrom " . $app['table']['pengguna'] . "\n\t\t\t\twhere username = '{$p_uname}'\n\t\t\t\t\t and password = '{$passwordhash}' and status = 'aktif'\n\t\t\t\tlimit 1";
$dbu->query($sql, $rs['login'], $nr['login']);
//echo $nr['login'];exit;
if ($nr['login']) {
$formix->reset();
// $_SESSION['inline_edit'] = "on";
$_SESSION['adminsession'] = $appx->serialize64($dbu->fetch($rs['login']));
header("location: " . $app['webmin'] . "/index.php?act=home");
exit;
} else {
//echo "masuk jeh nang kene";exit;
$msgx->set_msg($app[lang][error]['invalid_login']);
$msgx->build_msg();
header("location: index.php");
exit;
}
} else {
$msgx->set_msg($app[lang][error]['invalid_login']);
$msgx->build_msg();
header("location: index.php");
exit;
}
}
/*******************************************************************************
* aksi : logout
* deskripsi : clear all cookies redirect to admin to login form
*******************************************************************************/
示例2: validate
function validate($type, $fields, $param = '')
{
global $app;
$msgx = new msg();
$fields = "\$" . str_replace(",", ",\$", $fields);
//print_r($fields);
eval("global {$fields};");
$arr = explode(",", $fields);
if ($type == '') {
while (list($k, $v) = each($arr)) {
$field = substr($v, 3);
$cmd = "\$v = {$v};";
eval($cmd);
if (!trim($v)) {
$msgx->set_msg("" . $app['lang']['field'][$field] . "" . $app['lang']['error']['empty'] . "");
$_SESSION['error_flag'] = 1;
}
}
}
if ($type == 'checkbox') {
while (list($k, $v) = each($arr)) {
$field = substr($v, 3);
$cmd = "\$v = {$v};";
eval($cmd);
if (!@count($v)) {
$msgx->set_msg("" . $app['lang']['field'][$field] . "" . $app['lang']['error']['checkbox'] . "");
$_SESSION['error_flag'] = 1;
}
}
}
if ($type == 'select') {
while (list($k, $v) = each($arr)) {
$field = substr($v, 3);
eval("\$v = {$v};");
if (!trim($v)) {
$msgx->set_msg("" . $app['lang']['field'][$field] . "" . $app['lang']['error']['select'] . "");
$_SESSION['error_flag'] = 1;
}
}
}
if ($type == 'email') {
while (list($k, $v) = each($arr)) {
$field = substr($v, 3);
eval("\$v = {$v};");
if (!ereg("/^(.+)@(.+)\\.(.+)\$/i", $v)) {
$msgx->set_msg("" . $app['lang']['field'][$field] . "" . $app['lang']['error']['email'] . "");
$_SESSION['error_flag'] = 1;
}
}
}
if ($type == 'date') {
while (list($k, $v) = each($arr)) {
$field = substr($v, 3);
eval("\$v = {$v};");
list($year, $month, $date) = explode('-', $v);
if (!checkdate($month, $day, $year)) {
$msgx->set_msg("" . $app['lang']['field'][$field] . "" . $app['lang']['error']['date'] . "");
$_SESSION['error_flag'] = 1;
}
}
}
if ($type == 'image') {
while (list($k, $v) = each($arr)) {
$field = substr($v, 3);
$var = substr($v, 1);
eval("\$v = {$v};");
list($file_max_size, $min_width, $max_width, $min_height, $max_height) = explode('|', $param);
$file['tmp_name'] = $_FILES[$var]['tmp_name'];
$file['name'] = $_FILES[$var]['name'];
$file['size'] = $_FILES[$var]['size'];
if ($file['size'] > 0) {
$pict = getimagesize($file['tmp_name']);
//print_r($pict);exit;
/*if (!(($pict[2] == 1) || ($pict[2] == 2) || ($pict[2] == 13))):
$error = 'ERR_TYPE';
if ($error):
$msgx->set_msg("{$app[lang][field][$field]} {$app[lang][error]['image.'.$error]}");
$_SESSION[error_flag] = 1;
endif;
endif;*/
if ($pict[0] < $min_width || $pict[0] > $max_width || $pict[1] < $min_height || $pict[1] > $max_height) {
$error = 'ERR_WIDTH';
if ($error) {
$msgx->set_msg("" . $app['lang']['field'][$field] . " " . $app['lang']['error']['image.' . $error] . "");
$_SESSION['error_flag'] = 1;
}
}
if ($file[size] > $file_max_size * 1024) {
$error = 'ERR_SIZE';
if ($error) {
$msgx->set_msg("" . $app['lang']['field'][$field] . " " . $app['lang']['error']['image.' . $error] . "");
$_SESSION['error_flag'] = 1;
}
}
}
}
}
if ($type == 'file') {
while (list($k, $v) = each($arr)) {
$field = substr($v, 3);
//.........这里部分代码省略.........