-
common.php //4-8 版本升级接口开发及演示 //获取版本升级信息 public function getversionUpgrade($appId) { $sql = "select * from `version_upgrade` where app_id = " . $appId ." and status = 1 limit 1"; $connect = Db::getInstance()->connect(); $result = mysql_query($sql,$connect); return mysql_fetch_assoc($result); }查看全部
-
单例模式连接数据库查看全部
-
PHP操作缓存查看全部
-
静态缓存查看全部
-
封装方法查看全部
-
调用产生json的代码查看全部
-
生成json的代码查看全部
-
通信数据的标准格式查看全部
-
PHP生成json数据查看全部
-
xml与json的区别查看全部
-
php生成json数据:json_encode($arr);查看全部
-
if (!is_numeric($appId) || !is_numeric($versionId)) { return Response::show(401,'参数不合法'); } //判断APP是否需要加密 $this->app = $this->getApp($appId); if (!$this->app) { return Response::show(402,'app_id不存在'); } if ($this->app['is_encryption'] && $encryptDid != md5($did . $this->app['key'])) { //如果is_encryption存在代表需要加密的 return Response::show(403,'没有该权限'); }查看全部
-
<?php require_once('./jsonxml.php'); require_once('./db.php'); class Common{ public $params; public function check(){ $this->params['app_id']=$appId=isset($_POST['app_id'])?$_POST['app_id']:''; $this->params['version_id']=$versionId=isset($_POST['version_id'])?$_POST['version_id']:''; $this->params['version_mini'] = $versionMini = isset($_POST['version_mini']) ? $_POST['version_mini'] : ''; $this->params['did'] = $did = isset($_POST['did']) ? $_POST['did'] : ''; $this->params['encrypt_did'] = $encryptDid = isset($_POST['encrypt_did']) ? $_POST['encrypt_did'] : ''; if (!is_numeric($appId) || !is_numeric($versionId)) { return Response::show(401,'参数不合法');} $this->app = $this->getApp($appId); if(!$this->app){return Response::show(402,'app_id不存在');} public function getApp($id){ $sql = "select * from `app` where id = " . $id ." and status = 1 limit 1"; //echo $sql;exit; $connect = Db::getInstance()->connect(); $result = mysql_query($sql,$connect); return mysql_fetch_assoc($result); }}查看全部
-
<?php require_once('./jsonxml.php'); require_once('./db.php'); class Common { public $params; public function check() { $this->params['app_id'] = $appId = isset($_POST['app_id']) ? $_POST['app_id'] : ''; $this->params['version_id'] = $versionId = isset($_POST['version_id']) ? $_POST['version_id'] : ''; $this->params['version_mini'] = $versionMini = isset($_POST['version_mini']) ? $_POST['version_mini'] : ''; $this->params['did'] = $did = isset($_POST['did']) ? $_POST['did'] : ''; $this->params['encrypt_did'] = $encryptDid = isset($_POST['encrypt_did']) ? $_POST['encrypt_did'] : ''; if (!is_numeric($appId) || !is_numeric($versionId)) { return Response::show(401,'参数不合法'); } //判断APP是否需要加密 $this->getApp($appId); } //获取app表里的信息 public function getApp($id) { $sql = "select * from `app` where id = " . $id ." and status = 1 limit 1"; //echo $sql;exit; $connect = Db::getInstance()->connect(); $result = mysql_query($sql,$connect); var_dump(mysql_fetch_assoc($result));exit; } }查看全部
-
init.html <html> <form action="http://127.0.0.1/mooc/app/init.php?format=xml" method="post"> 设备号:<input type="text" value="" name="did"/><br /> 版本号:<input type="text" value="" name="version_id"/><br /> 小版本号:<input type="text" value="" name="version_mini"/><br /> APP类型:<input type="text" value="" name="app_id"/><br /> encrypt_did:<input type="text" value="c39f07bf54425745d642498395ce144c" name="encrypt_did"/><br /> <input type="submit" value="提交"/> </form> </html>查看全部
举报
0/150
提交
取消