当前位置: 首页>>代码示例>>PHP>>正文


PHP msg::set_msg方法代码示例

本文整理汇总了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
*******************************************************************************/
开发者ID:salomay,项目名称:refreshin,代码行数:31,代码来源:index.php

示例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);
//.........这里部分代码省略.........
开发者ID:salomay,项目名称:refreshin,代码行数:101,代码来源:form.php


注:本文中的msg::set_msg方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。