欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

shopex中集成的站长统计功能的代码简单分析

程序员文章站 2022-09-24 17:14:37
复制代码 代码如下:
复制代码 代码如下:

<?php
//我们的域名,这里可以不唯一的
$domain = 'localhost';
//这个应该是cnzz授权给shopex的加密密钥,如果错了就不能快捷申请账号
$encodestr = 'a34dfwff';
//这个就是cnzz授权给shopex的快捷申请账号的url地址
$url = 'http://wss.cnzz.com/user/companion/shopex.php?domain='.$domain.'&key='.md5($domain.$encodestr);
//获取网页内容得到这样的一个字符串 80772914@3780692425
$res = file_get_contents($url);
//左边是cnzz统计的站点id,右边是密码
$res = explode('@',$res);
//登录到cnzz统计的url,把下面的地址复制到地址栏就可以看到效果了
//http://wss.cnzz.com/user/companion/shopex_login.php?site_id=80772914&password=3780692425
//会自动跳转到 http://wss.cnzz.com/v1/main.php?siteid=80772914&s=main_stat
$login = 'http://wss.cnzz.com/user/companion/shopex_login.php?site_id='.$res[0].'&password='.$res[1];
header("location:$login");