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


PHP getNchash函数代码示例

本文整理汇总了PHP中getNchash函数的典型用法代码示例。如果您正苦于以下问题:PHP getNchash函数的具体用法?PHP getNchash怎么用?PHP getNchash使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了getNchash函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getChatHtml

    public static function getChatHtml($layout)
    {
        $web_html = '';
        if ($layout != 'layout/msg_layout.php') {
            $config_file = BASE_ROOT_PATH . DS . 'chat' . DS . 'config' . DS . "config.ini.php";
            require_once $config_file;
            $avatar = getMemberAvatar($_SESSION['avatar']);
            $nchash = getNchash();
            $formhash = Security::getTokenValue();
            $css_url = CHAT_TEMPLATES_URL;
            $app_url = APP_SITE_URL;
            $chat_url = CHAT_SITE_URL;
            $node_url = NODE_SITE_URL;
            $shop_url = SHOP_SITE_URL;
            $web_html = <<<EOT
\t\t\t\t\t<link href="{$css_url}/css/chat.css" rel="stylesheet" type="text/css">
\t\t\t\t\t<link href="{$css_url}/css/home_login.css" rel="stylesheet" type="text/css">
\t\t\t\t\t<div style="clear: both;"></div>
\t\t\t\t\t<div id="web_chat_dialog" style="display: none;float:right;">
\t\t\t\t\t</div>
\t\t\t\t\t<a id="chat_login" href="javascript:void(0)" style="display: none;"></a> 
\t\t\t\t\t<script type="text/javascript">
\t\t\t\t\tvar APP_SITE_URL = '{$app_url}';
\t\t\t\t\tvar CHAT_SITE_URL = '{$chat_url}';
\t\t\t\t\tvar SHOP_SITE_URL = '{$shop_url}';
\t\t\t\t\tvar connect_url = "{$node_url}";
\t\t\t\t\t
\t\t\t\t\tvar layout = "{$layout}";
\t\t\t\t\tvar act_op = "{$_GET['act']}_{$_GET['op']}";
\t\t\t\t\tvar user = {};
\t\t\t\t\t
\t\t\t\t\tuser['u_id'] = "{$_SESSION['member_id']}";
\t\t\t\t\tuser['u_name'] = "{$_SESSION['member_name']}";
\t\t\t\t\tuser['s_id'] = "{$_SESSION['store_id']}";
\t\t\t\t\tuser['s_name'] = "{$_SESSION['store_name']}";
\t\t\t\t\tuser['avatar'] = "{$avatar}";
\t\t\t\t\t
\t\t\t\t\t\$("#chat_login").nc_login({
\t\t\t\t\t  action:'/index.php?act=login',
\t\t\t\t\t  nchash:'{$nchash}',
\t\t\t\t\t  formhash:'{$formhash}'
\t\t\t\t\t});
\t\t\t\t\t</script>
EOT;
            if (defined('APP_ID') && APP_ID != 'shop') {
                $web_html .= '<script type="text/javascript" src="' . RESOURCE_SITE_URL . '/js/perfect-scrollbar.min.js"></script>';
                $web_html .= '<script type="text/javascript" src="' . RESOURCE_SITE_URL . '/js/jquery.mousewheel.js"></script>';
            }
            $web_html .= '<script type="text/javascript" src="' . RESOURCE_SITE_URL . '/js/jquery.charCount.js" charset="utf-8"></script>';
            $web_html .= '<script type="text/javascript" src="' . RESOURCE_SITE_URL . '/js/jquery.smilies.js" charset="utf-8"></script>';
            $web_html .= '<script type="text/javascript" src="' . CHAT_RESOURCE_URL . '/js/user.js" charset="utf-8"></script>';
        }
        return $web_html;
    }
开发者ID:Maplecms,项目名称:shopnc-yhmall,代码行数:54,代码来源:chat.php

示例2: indexOp

	/**
	 * 登录操作
	 *
	 */
	public function indexOp(){
		$lang	= Language::getLangContent();
		$model_member	= Model('member');
			//检查登录状态
		$model_member->checkloginMember();
		$script="document.getElementsByName('codeimage')[0].src='".APP_SITE_URL."/index.php?act=seccode&op=makecode&nchash='+NC_HASH+'&t=' + Math.random();";
		$result = chksubmit(true,true,'num');
		if ($result !== false){
			if ($result === -11){
				showDialog(L('login_index_login_illegal'),'','error',$script,2);
			}elseif ($result === -12){
				showDialog(L('login_index_wrong_checkcode'),'','error',$script,2);
			}
			if (process::islock('login')) {
				showDialog(L('login_index_op_repeat'),APP_SITE_URL);
			}
			$array	= array();
			$array['member_name']	= $_POST['user_name'];
			$array['member_passwd']	= md5($_POST['password']);
			$member_info = $model_member->infoMember($array);
			if(is_array($member_info) and !empty($member_info)) {
			    if(!$member_info['member_state']){
			        showDialog($lang['login_index_account_stop']);
			    }
			} else {
			    process::addprocess('login');
			    showDialog($lang['login_index_login_fail'],'','error',$script,2);
			}
			$model_member->createSession($member_info);
			process::clear('login');

			// cookie中的cart存入数据库
			Model('cart')->mergecart($member_info,$_SESSION['store_id']);

			// cookie中的浏览记录存入数据库
			Model('goods_browse')->mergebrowse($_SESSION['member_id'],$_SESSION['store_id']);
			//添加会员积分
			$model_member->addPoint($member_info);

			showDialog(L('login_index_login_success'),'reload','succ','',2);
		}

		if(empty($_GET['ref_url'])) $_GET['ref_url'] = getReferer();
		Tpl::output('html_title',C('site_name').' - '.$lang['login_index_login']);
		Tpl::output('nchash',getNchash());
		if ($_GET['inajax'] == 1){
			Tpl::showpage('login_inajax','null_layout');
		}else{
			return false;
		}

	}
开发者ID:noikiy,项目名称:ejia,代码行数:56,代码来源:login.php

示例3: show_loginOp

 public function show_loginOp()
 {
     Tpl::output('nchash', getNchash());
     Tpl::setLayout('null_layout');
     Tpl::showpage('login');
 }
开发者ID:flying3615,项目名称:chuniang,代码行数:6,代码来源:seller_login.php

示例4: defined

<?php

defined('InShopNC') or exit('Access Invalid!');
?>
<script type="text/javascript">
    <?php 
if ($_SESSION['is_login'] != '1') {
    ?>
    $(document).ready(function(){
    //登陆窗口
    $("[nctype='article_attitude']").nc_login({
        nchash:'<?php 
    echo getNchash();
    ?>
',
        formhash:'<?php 
    echo Security::getTokenValue();
    ?>
',
        anchor:'cms_attitude_flag'
    });
    show_article_attitude();
    });
    <?php 
} else {
    ?>
$(document).ready(function(){
    $("[nctype='article_attitude']").click(function() {
        var article_id = <?php 
    echo $_GET['article_id'];
    ?>
开发者ID:Maplecms,项目名称:shopnc-yhmall,代码行数:31,代码来源:article_attitude.php

示例5: getNchash

	function() {
		$(this).removeClass("hover");
	});

    // 右侧bar用户信息
    $('div[nctype="a-barUserInfo"]').click(function(){
        $('div[nctype="barUserInfo"]').toggle();
    });
    // 右侧bar登录
    $('div[nctype="a-barLoginBox"]').click(function(){
        $('div[nctype="barLoginBox"]').toggle();
        document.getElementById('codeimage').src='<?php 
echo SHOP_SITE_URL;
?>
/index.php?act=seccode&op=makecode&nchash=<?php 
echo getNchash('login', 'index');
?>
&t=' + Math.random();
    });
    $('a[nctype="close-barLoginBox"]').click(function(){
        $('div[nctype="barLoginBox"]').toggle();
    });
    <?php 
if ($output['cart_goods_num'] > 0) {
    ?>
    $('#rtoobar_cart_count').html(<?php 
    echo $output['cart_goods_num'];
    ?>
).show();
    <?php 
}
开发者ID:xingch,项目名称:myshop,代码行数:31,代码来源:layout_top.php

示例6: show_registerOp

 public function show_registerOp()
 {
     Tpl::output('nchash', getNchash());
     Tpl::setLayout('null_layout');
     Tpl::showpage('register');
 }
开发者ID:bubargaininc,项目名称:oak_oak,代码行数:6,代码来源:seller_register.php

示例7: getNchash

$(document).ready(function() {
    $("#form_login").validate({
        errorPlacement:function(error, element) {
            element.prev(".repuired").append(error);
        },
        rules:{
            seller_name:{
                required:true
            },
            password:{
                required:true
            },
            captcha:{
                required:true,
                remote:{
                    url:"index.php?act=seccode&op=check&nchash=<?php echo getNchash();?>",
                    type:"get",
                    data:{
                        captcha:function() {
                            return $("#captcha").val();
                        }
                    }
                }
            }
        },
        messages:{
            seller_name:{
                required:"<i class='icon-exclamation-sign'></i>用户名不能为空"
            },
            password:{
                required:"<i class='icon-exclamation-sign'></i>密码不能为空"
开发者ID:noikiy,项目名称:travel,代码行数:31,代码来源:login.php

示例8: if

			user_name: "required",
			password: "required"
			<?php if(C('captcha_status_login') == '1') { ?>
            ,captcha : {
                required : true,
                remote   : {
                    url : '<?php echo SHOP_SITE_URL?>/index.php?act=seccode&op=check&nchash=<?php echo getNchash();?>',
                    type: 'get',
                    data:{
                        captcha : function(){
                            return $('#captcha').val();
                        }
                    },
                    complete: function(data) {
                        if(data.responseText == 'false') {
                        	document.getElementById('codeimage').src='<?php echo SHOP_SITE_URL?>/index.php?act=seccode&op=makecode&nchash=<?php echo getNchash();?>&t=' + Math.random();
                        }
                    }
                }
            }
			<?php } ?>
		},
		messages: {
			user_name: "<?php echo $lang['login_index_input_username'];?>",
			password: "<?php echo $lang['login_index_input_password'];?>"
			<?php if(C('captcha_status_login') == '1') { ?>
            ,captcha : {
                required : '<?php echo $lang['login_index_input_checkcode'];?>',
				remote	 : '<?php echo $lang['login_index_wrong_checkcode'];?>'
            }
			<?php } ?>
开发者ID:noikiy,项目名称:ejia,代码行数:31,代码来源:login.php

示例9: indexOp

 /**
  * 登录操作
  *
  */
 public function indexOp()
 {
     Language::read("home_login_index");
     $lang = Language::getLangContent();
     $model_member = Model('member');
     //检查登录状态
     $model_member->checkloginMember();
     if ($_GET['inajax'] == 1 && C('captcha_status_login') == '1') {
         $script = "document.getElementById('codeimage').src='" . APP_SITE_URL . "/index.php?act=seccode&op=makecode&nchash=" . getNchash() . "&t=' + Math.random();";
     }
     $result = chksubmit(true, C('captcha_status_login'), 'num');
     if ($result !== false) {
         if ($result === -11) {
             showDialog($lang['login_index_login_illegal'], '', 'error', $script);
         } elseif ($result === -12) {
             showDialog($lang['login_index_wrong_checkcode'], '', 'error', $script);
         }
         if (process::islock('login')) {
             showDialog($lang['nc_common_op_repeat'], SHOP_SITE_URL, '', 'error', $script);
         }
         $obj_validate = new Validate();
         $obj_validate->validateparam = array(array("input" => $_POST["user_name"], "require" => "true", "message" => $lang['login_index_username_isnull']), array("input" => $_POST["password"], "require" => "true", "message" => $lang['login_index_password_isnull']));
         $error = $obj_validate->validate();
         if ($error != '') {
             showDialog($error, SHOP_SITE_URL, 'error', $script);
         }
         $array = array();
         //v3-b11 by 33hao.com
         $array['member_name|member_email|member_mobile'] = $_POST['user_name'];
         $array['member_passwd'] = md5($_POST['password']);
         $member_info = $model_member->getMemberInfo($array);
         if (is_array($member_info) and !empty($member_info)) {
             if (!$member_info['member_state']) {
                 showDialog($lang['login_index_account_stop'], '' . 'error', $script);
             }
         } else {
             process::addprocess('login');
             showDialog($lang['login_index_login_fail'], '', 'error', $script);
         }
         $model_member->createSession($member_info);
         process::clear('login');
         // cookie中的cart存入数据库
         Model('cart')->mergecart($member_info, $_SESSION['store_id']);
         // cookie中的浏览记录存入数据库
         Model('goods_browse')->mergebrowse($_SESSION['member_id'], $_SESSION['store_id']);
         if ($_GET['inajax'] == 1) {
             showDialog('', $_POST['ref_url'] == '' ? 'reload' : $_POST['ref_url'], 'js');
         } else {
             redirect($_POST['ref_url']);
         }
     } else {
         //登录表单页面
         $_pic = @unserialize(C('login_pic'));
         if ($_pic[0] != '') {
             Tpl::output('lpic', UPLOAD_SITE_URL . '/' . ATTACH_LOGIN . '/' . $_pic[array_rand($_pic)]);
         } else {
             Tpl::output('lpic', UPLOAD_SITE_URL . '/' . ATTACH_LOGIN . '/' . rand(1, 4) . '.jpg');
         }
         if (empty($_GET['ref_url'])) {
             $ref_url = getReferer();
             if (!preg_match('/act=login&op=logout/', $ref_url)) {
                 $_GET['ref_url'] = $ref_url;
             }
         }
         Tpl::output('html_title', C('site_name') . ' - ' . $lang['login_index_login']);
         if ($_GET['inajax'] == 1) {
             Tpl::showpage('login_inajax', 'null_layout');
         } else {
             Tpl::showpage('login');
         }
     }
 }
开发者ID:lehman3087,项目名称:wanhaoshop,代码行数:76,代码来源:login.php

示例10: catch

<script> 
// <![CDATA[ 
if((window.navigator.appName.toUpperCase().indexOf("MICROSOFT")>=0)&&(document.execCommand)) 
    try{ 
        document.execCommand("BackgroundImageCache", false, true); 
   } 
catch(e){} 
// ]]> 
</script> 
<![endif]-->
<script>
var COOKIE_PRE = '<?php echo COOKIE_PRE;?>'; var _CHARSET = '<?php echo strtolower(CHARSET);?>'; var SITEURL = '<?php echo SHOP_SITE_URL;?>';
var SHOP_SITE_URL = '<?php echo SHOP_SITE_URL;?>';
var CIRCLE_SITE_URL = '<?php echo CIRCLE_SITE_URL;?>'; var _ISLOGIN = <?php echo intval($_SESSION['is_login']);?>;
var APP_SITE_URL = '<?php echo CIRCLE_SITE_URL;?>'; var RESOURCE_SITE_URL = '<?php echo RESOURCE_SITE_URL;?>';
var NC_HASH = '<?php echo getNchash();?>'; var NC_TOKEN = '<?php echo Security::getTokenValue();?>';
</script>
<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/js/jquery.js" charset="utf-8"></script>
<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/js/common.js" charset="utf-8"></script>
<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/js/jquery-ui/jquery.ui.js" charset="utf-8"></script>
<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/js/jquery.poshytip.min.js" charset="utf-8"></script>
<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/js/jquery.icheck.min.js"></script>
<script type="text/javascript" id="dialog_js" src="<?php echo RESOURCE_SITE_URL;?>/js/dialog/dialog.js" charset="utf-8"></script>
<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/js/qtip/jquery.qtip.min.js"></script>
<link href="<?php echo RESOURCE_SITE_URL;?>/js/qtip/jquery.qtip.min.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="<?php echo CIRCLE_RESOURCE_SITE_URL;?>/js/common.js" charset="utf-8"></script> 
<link href="<?php echo RESOURCE_SITE_URL;?>/js/perfect-scrollbar.min.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/js/perfect-scrollbar.min.js"></script>
</head>
<body>
<?php require_once(circle_template('layout/top'));?>
开发者ID:noikiy,项目名称:ejia,代码行数:31,代码来源:circle_layout.php

示例11: indexOp

 /**
  * 登录操作
  *
  */
 public function indexOp()
 {
     Language::read("home_login_index");
     $lang = Language::getLangContent();
     $model_member = Model('member');
     //检查登录状态
     $model_member->checkloginMember();
     if ($_GET['inajax'] == 1 && C('captcha_status_login') == '1') {
         $script = "document.getElementById('codeimage').src='" . APP_SITE_URL . "/index.php?act=seccode&op=makecode&nchash=" . getNchash() . "&t=' + Math.random();";
     }
     $result = chksubmit(true, C('captcha_status_login'), 'num');
     if ($result !== false) {
         if ($result === -11) {
             showDialog($lang['login_index_login_illegal']);
         } elseif ($result === -12) {
             showDialog($lang['login_index_wrong_checkcode']);
         }
         if (processClass::islock('login')) {
             showDialog($lang['nc_common_op_repeat'], SHOP_SITE_URL);
         }
         $obj_validate = new Validate();
         $obj_validate->validateparam = array(array("input" => $_POST["user_name"], "require" => "true", "message" => $lang['login_index_username_isnull']), array("input" => $_POST["password"], "require" => "true", "message" => $lang['login_index_password_isnull']));
         $error = $obj_validate->validate();
         if ($error != '') {
             showValidateError($error);
             exit;
         }
         if (C('ucenter_status')) {
             $model_ucenter = Model('ucenter');
             $member_id = $model_ucenter->userLogin(trim($_POST['user_name']), trim($_POST['password']));
             if (intval($member_id) == 0) {
                 showDialog($lang['login_index_login_again']);
             }
         }
         $array = array();
         $array['member_name'] = $_POST['user_name'];
         $array['member_passwd'] = md5($_POST['password']);
         $member_info = $model_member->infoMember($array);
         if (is_array($member_info) and !empty($member_info)) {
             if (!$member_info['member_state']) {
                 showDialog($lang['login_index_account_stop']);
             }
         } else {
             processClass::addprocess('login');
             showDialog($lang['login_index_login_fail']);
         }
         $model_member->createSession($member_info);
         processClass::clear('login');
         //            echo "member_identity:".$member_info['member_identity'];
         //            echo "inajax:".$_GET['inajax'];
         //            echo "ref_url:".$_POST['ref_url'];
         if ($member_info['member_identity'] != null && $member_info['member_verifycode'] != null) {
             //从积分系统获取预备金信息
             $this->getPredeposit($member_info);
         }
         // cookie中的cart存入数据库
         $this->mergecart($member_info);
         //添加会员积分
         if (C('points_isuse')) {
             //一天内只有第一次登录赠送积分
             if (trim(@date('Y-m-d', $member_info['member_login_time'])) != trim(date('Y-m-d'))) {
                 $points_model = Model('points');
                 $points_model->savePointsLog('login', array('pl_memberid' => $member_info['member_id'], 'pl_membername' => $member_info['member_name']), true);
             }
         }
         if (C('ucenter_status')) {
             $extrajs = $model_ucenter->outputLogin($member_info['member_id'], trim($_POST['password']));
         } elseif (empty($_GET['inajax'])) {
             if (empty($_POST['ref_url'])) {
                 @header('location: index.php');
                 exit;
             } else {
                 @header('location: ' . $_POST['ref_url']);
                 exit;
             }
         }
         showDialog($lang['login_index_login_success'], $_POST['ref_url'], 'succ', $extrajs);
     } else {
         //登录表单页面
         $_pic = @unserialize(C('login_pic'));
         if ($_pic[0] != '') {
             Tpl::output('lpic', UPLOAD_SITE_URL . '/' . ATTACH_LOGIN . '/' . $_pic[array_rand($_pic)]);
         } else {
             Tpl::output('lpic', UPLOAD_SITE_URL . '/' . ATTACH_LOGIN . '/' . rand(1, 4) . '.jpg');
         }
         if (empty($_GET['ref_url'])) {
             $ref_url = getReferer();
             if (!preg_match('/act=login&op=logout/', $ref_url)) {
                 $_GET['ref_url'] = $ref_url;
             }
         }
         Tpl::output('html_title', C('site_name') . ' - ' . $lang['login_index_login']);
         if ($_GET['inajax'] == 1) {
             Tpl::showpage('login_inajax', 'null_layout');
         } else {
             Tpl::showpage('login');
//.........这里部分代码省略.........
开发者ID:noikiy,项目名称:shop-2,代码行数:101,代码来源:login.php

示例12: function

$(document).ready(function(){
	$("#login_form ").validate({
        errorPlacement: function(error, element){
            var error_td = element.parent('dd');
            error_td.find('label').hide();
            error_td.append(error);
        },
		rules: {
			user_name: "required",
			password: "required"
			<?php if(C('captcha_status_login') == '1') { ?>
            ,captcha : {
                required : true,
                minlength: 4,
                remote   : {
                    url : '<?php echo SHOP_SITE_URL?>/index.php?act=seccode&op=check&nchash=<?php echo getNchash();?>',
                    type: 'get',
                    data:{
                        captcha : function(){
                            return $('#captcha').val();
                        }
                    }
                }
            }
			<?php } ?>
		},
		messages: {
			user_name: "<?php echo $lang['login_index_input_username'];?>",
			password: "<?php echo $lang['login_index_input_password'];?>"
			<?php if(C('captcha_status_login') == '1') { ?>
            ,captcha : {
开发者ID:noikiy,项目名称:ejia,代码行数:31,代码来源:store_joinin.php


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