当前位置:Gxlcms > PHP教程 > 微信公众平台天气查询,火车票查询,快递查询,小黄鸡,翻译,公交查询的实现

微信公众平台天气查询,火车票查询,快递查询,小黄鸡,翻译,公交查询的实现

时间:2021-07-01 10:21:17 帮助过:31人阅读

大家可以去出处扫描二维码试试
  1. /**
  2. * wechat php test
  3. */
  4. include("ABClient.php"); //爱帮网申请 然后下载的sdk
  5. define("FANAPK", "API key"); //这个百度应用duapp.com创建一个应用获得的 API key
  6. define("WAPK","key"); //这个key地址http://lbsyun.baidu.com/apiconsole/key?application=key来获取
  7. //define your token
  8. define("TOKEN", "这里写你自己的token");
  9. $wechatObj = new wechatCallbackapiTest();
  10. $wechatObj->responseMsg();
  11. class wechatCallbackapiTest
  12. {
  13. private $model;
  14. private $name;
  15. public function __construct(){
  16. $this->model = new ABClient();
  17. $a = $this->model->test_transfer();
  18. $this->name = include("name.php");
  19. }
  20. public function valid()
  21. {
  22. $echoStr = $_GET["echostr"];
  23. //valid signature , option
  24. if($this->checkSignature()){
  25. echo $echoStr;
  26. exit;
  27. }
  28. }
  29. public function responseMsg()
  30. {
  31. //get post data, May be due to the different environments
  32. $postStr = $GLOBALS["HTTP_RAW_POST_DATA"];
  33. //extract post data
  34. if (!empty($postStr)){
  35. $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);
  36. $fromUsername = $postObj->FromUserName;
  37. $toUsername = $postObj->ToUserName;
  38. $type = $postObj->MsgType;
  39. $event = $postObj->Event;
  40. $c = $postObj->Location_X;
  41. $d = $postObj->Location_Y;
  42. $keyword = trim($postObj->Content);
  43. $time = time();
  44. $msgid = $postObj->MsgId;
  45. $textTpl = "
  46. %s
  47. 0
  48. ";
  49. if($type == "event" && $event == "subscribe")
  50. {
  51. $msgType = "text";
  52. $contentStr.= "欢迎关注微度网络,该公众平台有以下几种功能:\n\n";
  53. $contentStr.= "1.直接输入汉字或者中文进行中英文翻译,如“你好”\n";
  54. $contentStr.= "2.输入“天气+地区”进行天气查询,如“天气+石家庄”\n";
  55. $contentStr.= "3.输入“城市+起点+终点”进行公交查询,如“石家庄+火车站+宫家庄”\n";
  56. $contentStr.= "4.输入“@任何内容”跟小贱鸡聊天,如“@小贱鸡”\n";
  57. $contentStr.= "5.微信发送您的地理位置进行天气查询,您可以试一试\n";
  58. $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);
  59. echo $resultStr;
  60. }else if($type == "text"){
  61. $keywords = explode("+",$keyword);
  62. $b = explode("@",$keyword);
  63. if(isset($b[1])){
  64. $contentStr = $this->simsim($b[1]);
  65. $msgType = "text";
  66. $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);
  67. echo $resultStr;
  68. exit();
  69. }
  70. if($keywords[0]=="火车"){
  71. $city = $keywords[1];
  72. $end = $keywords[2];
  73. $time = $keywords[3];
  74. $result = $this->doget($city,$end,$time);
  75. if(!empty($result)){
  76. $result = strip_tags($result['datas']);
  77. $return_str = str_replace(" ","",$result);
  78. $return_str = str_replace("\\n","",$return_str);
  79. $a = explode(",",$return_str);
  80. $name =array();
  81. $c = array_chunk($a,16);
  82. array_pop($c);
  83. foreach($c as $k =>$v){
  84. $str="余票:\n商务座:".$v[5].",特等座:".$v[6].",一等座:".$v[7].",二等座:".$v[8].",高级软卧:".$v[9].",软卧:".$v[10].",硬卧:".$v[11].",软座:".$v[12].",硬座:".$v[13].",无座:".$v[14].",其他:".$v[15];
  85. $str = preg_replace("/硬座\:--,/","",$str);
  86. $str = preg_replace("/商务座\:--,/","",$str);
  87. $str = preg_replace("/特等座\:--,/","",$str);
  88. $str = preg_replace("/一等座\:--,/","",$str);
  89. $str = preg_replace("/二等座\:--,/","",$str);
  90. $str = preg_replace("/高级软卧\:--,/","",$str);
  91. $str = preg_replace("/软卧\:--,/","",$str);
  92. $str = preg_replace("/硬卧\:--,/","",$str);
  93. $str = preg_replace("/软座\:--,/","",$str);
  94. $str = preg_replace("/硬座\:--,/","",$str);
  95. $str = preg_replace("/其他\:--/","",$str);
  96. $contentStr.="车次:{$v[1]},发站:{$v[2]},到站:{$v[3]},历时:{$v[4]}。\n{$str}\n\n";
  97. if($k == 12){
  98. break;
  99. }
  100. }
  101. }else{
  102. $contentStr.="抱歉没有查到";
  103. }
  104. $msgType = "text";
  105. $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);
  106. echo $resultStr;
  107. exit();
  108. }
  109. if(isset($keywords[1])&&!isset($keywords[2])){
  110. if($this->pexpress(trim($keywords[0]))){
  111. $a = $this->express(trim($keywords[0]),trim($keywords[1]));
  112. if($a["message"]=="ok"){
  113. if($a['ischeck']==1){
  114. $contentStr.="您的包裹已经签收\n\n";
  115. }else{
  116. $contentStr.="您的包裹还未签收\n\n";
  117. }
  118. $data = $a['data'];
  119. foreach($data as $k =>$v){
  120. $contentStr.="更新时间:{$v["time"]}\n物流状态:{$v["context"]}\n\n";
  121. }
  122. }else{
  123. $contentStr = "查询失败,请输入正确后查询";
  124. }
  125. $msgType = "text";
  126. $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);
  127. echo $resultStr;
  128. }else{
  129. $weather = $this->weather($keywords[1]);
  130. if(!empty($weather))
  131. {
  132. $data = $this->json2array($weather);
  133. foreach($data as $k =>$v)
  134. {
  135. $str.=$v['date'].'。天气:'.$v['weather'].'。风速:'.$v['wind'].'。温度:'.$v['temperature']."\n\n";
  136. }
  137. }else{
  138. $str="请您输入正确的地址,输入方式如天气+北京";
  139. }
  140. $msgType = "text";
  141. $contentStr = $str;
  142. $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);
  143. echo $resultStr;
  144. }
  145. }else if(isset($keywords[2])&&($keywords[0]!=="火车")){
  146. $city = $keywords[0];
  147. $start = $keywords[1];
  148. $end =$keywords[2];
  149. $a = $this->model->test_transfer($city,$start,$end);
  150. if(!empty($a)){
  151. foreach($a as $k=>$v){
  152. $contentStr.= "线路{$c}:".$v['dist']."米。估计耗费时间:{$v['time']}分钟。\n乘车线路:{$v['segments']["segment"][0]["line_name"]}。\n上车地点:{$v['segments']["segment"][0]["start_stat"]}。\n下车地点:{$v['segments']["segment"][0]["end_stat"]}。\n经过路线:{$v['segments']["segment"][0]["stats"]}\n\n";
  153. if($k == 4){
  154. break;
  155. }
  156. }
  157. }else{
  158. $contentStr="抱歉没有查询到";
  159. }
  160. $msgType = "text";
  161. $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);
  162. echo $resultStr;
  163. }else{
  164. $fanyi = $this->fanyi($keyword);
  165. $msgType = "text";
  166. $contentStr = $fanyi;
  167. $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);
  168. echo $resultStr;
  169. }
  170. }else if($type == 'location'){
  171. $result = $this->address($c,$d);
  172. if(isset($result['district'])){
  173. $weather = $this->weather($result['district']);
  174. if(!$weather){
  175. $weather = $this->weather($result['city']);
  176. }
  177. }else{
  178. $weather = $this->weather($result['city']);
  179. }
  180. $data = $this->json2array($weather);
  181. foreach($data as $k =>$v){
  182. $str.=$v['date'].'。天气:'.$v['weather'].'。风速:'.$v['wind'].'。温度:'.$v['temperature']."\n\n";
  183. }
  184. $msgType = "text";
  185. $contentStr = $str;
  186. $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);
  187. echo $resultStr;
  188. }else{
  189. echo "您可以输入点什么";
  190. }
  191. }else {
  192. echo "";
  193. exit;
  194. }
  195. }
  196. //获取地理位置的
  197. private function address($addx,$addy)
  198. {
  199. $arr = array();
  200. $result = $this->map_text("http://api.map.baidu.com/geocoder/v2/?ak=".WAPK."&callback=renderReverse&location={$addx},{$addy}&output=xml&pois=0");
  201. $data = simplexml_load_string($result, 'SimpleXMLElement', LIBXML_NOCDATA);
  202. $result = $this->json2array($data);
  203. $arr = $result["result"]["addressComponent"];
  204. $address = $result['result']['formatted_address'];
  205. array_push($arr,$address);
  206. return $arr;
  207. }
  208. //解析json为数组
  209. private function json2array($json) {
  210. if ($json) {
  211. foreach ((array)$json as $k=>$v) {
  212. $data[$k] = !is_string($v) ? $this->json2array($v) : $v;
  213. }
  214. return $data;
  215. }
  216. }
  217. //获取天气信息
  218. private function weather($data)
  219. {
  220. //根据API调用输出数据
  221. $url="http://api.map.baidu.com/telematics/v2/weather?location={$data}&output=json&ak=".WAPK;
  222. $weather=$this->map_text($url);
  223. $data = json_decode($weather);
  224. return $data->results;
  225. }
  226. //调用翻译的api
  227. private function fanyi($data)
  228. {
  229. //根据API调用输出数据
  230. $url="http://openapi.baidu.com/public/2.0/bmt/translate?client_id=".FANAPK."&q={$data}&from=auto&to=auto";
  231. $fanyi=$this->map_text($url);
  232. $shuju=json_decode($fanyi);
  233. $result=$shuju->trans_result;
  234. return $result[0]->dst;
  235. }
  236. //解析地址的api
  237. private function map_text($url)
  238. {
  239. if(!function_exists('file_get_contents')) {
  240. $file_contents = file_get_contents($url);
  241. } else {
  242. $ch = curl_init();
  243. $timeout = 5;
  244. curl_setopt ($ch, CURLOPT_URL, $url);
  245. curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
  246. curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
  247. $file_contents = curl_exec($ch);
  248. curl_close($ch);
  249. }
  250. return $file_contents;
  251. }
  252. private function checkSignature()
  253. {
  254. $signature = $_GET["signature"];
  255. $timestamp = $_GET["timestamp"];
  256. $nonce = $_GET["nonce"];
  257. $token = TOKEN;
  258. $tmpArr = array($token, $timestamp, $nonce);
  259. sort($tmpArr);
  260. $tmpStr = implode( $tmpArr );
  261. $tmpStr = sha1( $tmpStr );
  262. if( $tmpStr == $signature ){
  263. return true;
  264. }else{
  265. return false;
  266. }
  267. }
  268. private function simsim($keywords){
  269. $curlPost=array("txt"=>$keywords);
  270. $ch = curl_init();//初始化curl
  271. curl_setopt($ch,CURLOPT_URL,'http://xiaohuangji.com/ajax.aspx');//抓取指定网页
  272. curl_setopt($ch, CURLOPT_HEADER, 0);//设置header
  273. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);//要求结果为字符串且输出到屏幕上
  274. curl_setopt($ch, CURLOPT_POST, 1);//post提交方式
  275. curl_setopt($ch, CURLOPT_POSTFIELDS, $curlPost);
  276. $data = curl_exec($ch);//运行curl
  277. curl_close($ch);
  278. return $data;
  279. }
  280. private function pexpress($exname){
  281. $a = $this->map_text("http://www.kuaidi100.com/");
  282. preg_match_all("/data\-code\=\"(?P\w+)\"\>\(?P.*)\<\/span>/iU",$a,$b);<li> $name = array();<li> foreach($b['title'] as $k=>$v){<li> $name[$v] = $b['name'][$k];<li> }<li> if(!empty($name[$exname])){<li> return true;<li> }else{<li> return false;<li> }<li> }<li> private function express($keywords,$number){<li> $a = $this->map_text("http://www.kuaidi100.com/");<li> preg_match_all("/data\-code\=\"(?P<name>\w+)\"\>\<span\>(?P<title>.*)\<\/span>/iU",$a,$b);<li> $name = array();<li> foreach($b['title'] as $k=>$v){<li> $name[$v] = $b['name'][$k];<li> }<li> $this->name = $name;<li> $keywords = $name[$keywords];<li> $url = "http://www.kuaidi100.com/query?type={$keywords}&postid={$number}";<li> $result = $this->map_text($url);<li> $result = $this->json2array(json_decode($result));<li> return $result;<li> }<li> <li> private function doget ($start,$end,$time) // get获取数据使用<li> {<li> if(empty($time)){<li> $time = date('Y-m-d',time());<li> }else{<li> if(substr($time,0,1)!=0){<li> $time = date('Y-0',time()).$time;<li> }else{<li> $time = date('Y-',time()).$time;<li> }<li> }<li> $star = $this->name[$start];<li> $end = $this->name[$end];<li> $url = "http://dynamic.12306.cn/otsquery/query/queryRemanentTicketAction.do?method=queryLeftTicket&orderRequest.train_date={$time}&orderRequest.from_station_telecode={$star}&orderRequest.to_station_telecode={$end}&orderRequest.train_no=&trainPassType=QB&trainClass=QB%23D%23Z%23T%23K%23QT%23&includeStudent=00&seatTypeAndNum=&orderRequest.start_time_str=00%3A00--24%3A00";<li> $optionget = array('http' => array('method' => "GET", 'header' => "User-Agent:Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.21022; .NET CLR 3.0.04506; CIBA)\r\nAccept:*/*\r\nReferer:http://dynamic.12306.cn/otsquery/query/queryRemanentTicketAction.do?method=init")); <li> $file = file_get_contents($url, false , stream_context_create($optionget));<li> return $this->json2array(json_decode($file));<li> }<li> <li>}<li><li>?></ol><em onclick="copycode($('code_j53'));"></em></td></tr></table> </div> <div class=""> <ul class="m-news-opt fix"> <li class="opt-item"> <a href='/PHPjiqiao-175819.html' target='_blank'><p>< 上一篇</p><p class="ellipsis">MyPHPasimplePHPFrameworkv0.05</p></a> </li> <li class="opt-item ta-r"> <a href='/PHPjiqiao-175821.html' target='_blank'><p>下一篇 ></p><p class="ellipsis">使用php创建WebSocket服务</p></a> </li> </ul> </div> </div> </div> <div class="g-title fix"> <h2 class="title-txt">人气教程排行</h2> </div> <div class="m-rank u-dashed mb40"> <ul> <li class="rank-item"> <a href="/PHPjiqiao-379253.html" title='php如何获取跳转前的url' class="item-name ellipsis" target="_blank"> <span class="g-art-count fr">174次</span> <span class="g-sort-num top">1</span> php如何获取跳转前的url </a> </li> <li class="rank-item"> <a href="/PHPjiqiao-379019.html" title='php格林威治时间转换成当前时间的方法' class="item-name ellipsis" target="_blank"> <span class="g-art-count fr">174次</span> <span class="g-sort-num second">2</span> php格林威治时间转换成当前时间的方法 </a> </li> <li class="rank-item"> <a href="/PHPjiqiao-366629.html" title='为什么php不能做大型系统?' class="item-name ellipsis" target="_blank"> <span class="g-art-count fr">174次</span> <span class="g-sort-num third">3</span> 为什么php不能做大型系统? </a> </li> <li class="rank-item"> <a href="/PHPjiqiao-207623.html" title='range函数怎么用' class="item-name ellipsis" target="_blank"> <span class="g-art-count fr">174次</span> <span class="g-sort-num ">4</span> range函数怎么用 </a> </li> <li class="rank-item"> <a href="/PHPjiqiao-162433.html" title='php中计算页面加载时间几种方法总结_PHP教程' class="item-name ellipsis" target="_blank"> <span class="g-art-count fr">174次</span> <span class="g-sort-num ">5</span> php中计算页面加载时间几种方法总结_PHP教程 </a> </li> <li class="rank-item"> <a href="/PHPjiqiao-140221.html" title='求帮助,关于paypal支付返回值修改订单状态' class="item-name ellipsis" target="_blank"> <span class="g-art-count fr">174次</span> <span class="g-sort-num ">6</span> 求帮助,关于paypal支付返回值修改订单状态 </a> </li> <li class="rank-item"> <a href="/PHPjiqiao-103588.html" title='typecho怎么配置文章内容页?' class="item-name ellipsis" target="_blank"> <span class="g-art-count fr">174次</span> <span class="g-sort-num ">7</span> typecho怎么配置文章内容页? </a> </li> <li class="rank-item"> <a href="/PHPjiqiao-99213.html" title='PhpStorm左侧structure不显示文件的方法列表是这么回事?' class="item-name ellipsis" target="_blank"> <span class="g-art-count fr">174次</span> <span class="g-sort-num ">8</span> PhpStorm左侧structure不显示文件的方法列表是这么回事? </a> </li> <li class="rank-item"> <a href="/PHPjiqiao-92208.html" title='查看PHP的环境变量_PHP' class="item-name ellipsis" target="_blank"> <span class="g-art-count fr">174次</span> <span class="g-sort-num ">9</span> 查看PHP的环境变量_PHP </a> </li> <li class="rank-item"> <a href="/PHPjiqiao-170.html" title='PHP Primary script unknown 解决方法总结' class="item-name ellipsis" target="_blank"> <span class="g-art-count fr">174次</span> <span class="g-sort-num ">10</span> PHP Primary script unknown 解决方法总结 </a> </li> <li class="rank-item"> <a href="/PHPjiqiao-148.html" title='php的命名空间与自动加载实现方法' class="item-name ellipsis" target="_blank"> <span class="g-art-count fr">174次</span> <span class="g-sort-num ">11</span> php的命名空间与自动加载实现方法 </a> </li> <li class="rank-item"> <a href="/PHPjiqiao-133.html" title='解决laravel 出现ajax请求419(unknown status)的问题' class="item-name ellipsis" target="_blank"> <span class="g-art-count fr">174次</span> <span class="g-sort-num ">12</span> 解决laravel 出现ajax请求419(unknown status)的问题 </a> </li> <li class="rank-item"> <a href="/PHPjiqiao-462817.html" title='php 如何删除mysql记录' class="item-name ellipsis" target="_blank"> <span class="g-art-count fr">173次</span> <span class="g-sort-num ">13</span> php 如何删除mysql记录 </a> </li> <li class="rank-item"> <a href="/PHPjiqiao-388448.html" title='PHP如何替换数组中的指定元素' class="item-name ellipsis" target="_blank"> <span class="g-art-count fr">173次</span> <span class="g-sort-num ">14</span> PHP如何替换数组中的指定元素 </a> </li> <li class="rank-item"> <a href="/PHPjiqiao-124270.html" title='怎么去除字符串中非汉字、非字母、非数字的字符' class="item-name ellipsis" target="_blank"> <span class="g-art-count fr">173次</span> <span class="g-sort-num ">15</span> 怎么去除字符串中非汉字、非字母、非数字的字符 </a> </li> <li class="rank-item"> <a href="/PHPjiqiao-112291.html" title='mysql如何一次执行多条SQL语句' class="item-name ellipsis" target="_blank"> <span class="g-art-count fr">173次</span> <span class="g-sort-num ">16</span> mysql如何一次执行多条SQL语句 </a> </li> <li class="rank-item"> <a href="/PHPjiqiao-110669.html" title='修改header里面的Connection为close解决方法' class="item-name ellipsis" target="_blank"> <span class="g-art-count fr">173次</span> <span class="g-sort-num ">17</span> 修改header里面的Connection为close解决方法 </a> </li> <li class="rank-item"> <a href="/PHPjiqiao-153.html" title='PHP基于session.upload_progress 实现文件上传进度显示功能详解' class="item-name ellipsis" target="_blank"> <span class="g-art-count fr">173次</span> <span class="g-sort-num ">18</span> PHP基于session.upload_progress 实现文件上传进度显示功能详解 </a> </li> <li class="rank-item"> <a href="/PHPjiqiao-125.html" title='php5.6.x到php7.0.x特性小结' class="item-name ellipsis" target="_blank"> <span class="g-art-count fr">173次</span> <span class="g-sort-num ">19</span> php5.6.x到php7.0.x特性小结 </a> </li> <li class="rank-item"> <a href="/PHPjiqiao-378118.html" title='php为什么会出现504错误' class="item-name ellipsis" target="_blank"> <span class="g-art-count fr">172次</span> <span class="g-sort-num ">20</span> php为什么会出现504错误 </a> </li> </ul> </div> </div> </div> <!-- / 教程内容页 --> </div> </div> <!-- 页尾 --> <div class="footer"> 本站所有资源全部来源于网络,若本站发布的内容侵害到您的隐私或者利益,请联系我们删除!</div> <!-- / 页尾 --> <script type="text/javascript" src="/kan/js/read.js"></script> <div style="display:none"> <div class="login-box" id="login-dialog"> <div class="login-top"><a class="current" rel="nofollow" id="login1" onclick="setTab('login',1,2);" >登录</a></div> <div class="login-form" id="nav-signin"> <!-- <div class="login-ico"><a rel="nofollow" class="qq" id="qqlogin" target="_blank" href="/user-center-qqlogin.html"> QQ </a></div> --> <div class="login-box-form" id="con_login_1"> <form id="loginform" action="/user-center-login.html" method="post" onsubmit="return false;"> <p class="int-text"> <input class="email" id="username" name="username" type="text" value="用户名或Email" onfocus="if(this.value=='用户名或Email'){this.value='';}" onblur="if(this.value==''){this.value='用户名或Email';};" ></p> <p class="int-text"> <input class="password1" type="password" id="password" name="password" value="******" onBlur="if(this.value=='') this.value='******';" onFocus="if(this.value=='******') this.value='';" > </p> <p class="int-info"> <label class="ui-label"> </label> <label for="agreement" class="ui-label-checkbox"> <input type="checkbox" value="" name="cookietime" id="cookietime" checked="checked" value="2592000"> <input type="hidden" name="notforward" id="notforward" value="1"> <input type="hidden" name="dosubmit" id="dosubmit" value="1">记住我的登录 </label> <a rel="nofollow" class="aright" href="/user-center-forgetpwd.html" target="_blank"> 忘记密码? </a></p> <p class="int-btn"><a rel="nofollow" id="loginbt" class="loginbtn"><span>登录</span></a></p> </form> </div> <form id="regform" action="/user-center-reg.html" method="post"> <div class="login-reg" style="display: none;" id="con_login_2"> <input type="hidden" name="t" id="t"/> <p class="int-text"> <input id="email" name="email" type="text" value="Email" onfocus="if(this.value=='Email'){this.value='';}" onblur="if(this.value==''){this.value='Email';};"></p> <p class="int-text"> <input id="uname" name="username" type="text" value="用户名或昵称" onfocus="if(this.value=='用户名或昵称'){this.value='';}" onblur="if(this.value==''){this.value='用户名或昵称';};"></p> <p class="int-text"> <input type="password" id="pwd" name="password" value="******" onBlur="if(this.value=='') this.value='******';" onFocus="if(this.value=='******') this.value='';"> </p> <p class="int-text1"><span class="inputbox"> <input id="validate" name="validate" type="text" value="验证码" onfocus="if(this.value=='验证码'){this.value='';}" onblur="if(this.value==''){this.value='验证码';};"> </span><span class="yzm-img"><img src="/user-checkcode-index" alt="看不清楚换一张" id="indexlogin"></p> <p class="int-info"> <label> <input value="" name="agreement" id="agreement" CHECKED="checked" type="checkbox"> 我已阅读<a rel="nofollow" href="/user-center-agreement.html">用户协议</a>及<a rel="nofollow" href="/user-center-agreement.html">版权声明</a></label> </p> <p class="int-btn"><input type="hidden" name="dosubmit"/> <a rel="nofollow" class="loginbtn" id="register"><span>注册</span></a></p> </div> </form> </div> </div> </div> </div> <script type="text/javascript" src="/kan/js/foot_js.js"></script> <script> var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?6dc1c3c5281cf70f49bc0bc860ec24f2"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </script> <script type="text/javascript" src="/layui/layui.js"></script> <script> layui.use('code', function() { layui.code({ elem: 'pre', //默认值为.layui-code about: false, skin: 'notepad', title: 'php怎么实现数据库验证跳转代码块', encode: true //是否转义html标签。默认不开启 }); }); </script> </body> </html>