TLingC's Zone
TLingC's Zone


文章归档

网页APP与后端JSON通讯方案

后端api.php,用于对客户端请求进行处理 <?php include_once( 'api.function.php' ); header("Content-type:application/json"); header("Access-Control-Allow-Origin: *"); $action = $_GET['action']; if($action == "" || $action == NULL) { SendReply(ERR_GENERAL,""); } else if(!function_exists($action)) { SendReply(ERR_GENERAL,""); } call_user_func($action); function hello_world() { $data = "HELLO WORLD!"; Send…

194   2017-06-25  

用itchat做一个简单的关键词回复微信机器人

itchat组件:https://github.com/littlecodersh/ItChat 下载后根据安装教程 pip install itchat 安装itchat 新建wxbot.py #coding=utf8 import itchat import time @itchat.msg_register('Text') def text_reply(msg): f = open("words.txt") for line in f: splited = line.split(',') if splited[0] in msg['Text']: return splited[1].replace("\n", "") f.close() itchat.auto_login(True, enableCmdQR=True) itchat.run() 新建words.txt(注意文件…

496   2017-06-25  

上海之行

这篇文章没有摘要

81   2017-06-24  

jQuery实现垂直居中+iframe高度自适应

jQuery垂直居中 if ($(".ClassName").height() = $(window).height()) $(".ClassName").css("marginTop",$(window).height()/2 - $(".ClassName").height()/2); jQuery iframe高度自适应 $(document).ready( function() { $(window).resize(function(){$(".iframeName").height($(window).height());}); $(".iframeName").load(function(){$(this).height($(window).height());}); } );

184   2017-06-24  

centos yum install PHP后许多模块没有安装的解决方法

PHP程序本地调试一切正常,传上centos一直报函数不存在,后来发现是相应的模块没有安装,用yum install php-devel安装PHP开发包可以解决大多数的模块不存在问题。

148   2017-06-23  

PHP curl post/get数据函数

Post function postData($url, $data) { $ch = curl_init(); $timeout = 300; curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_REFERER, ""); //来路 curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); $handles = curl_exec($ch); curl_close($ch); return $handles; } Get function getData($url) { $ch = curl_init()…

147   2017-06-21