摘要:当前台请求为post时,在request请求中要加上 header:{ 'content-type':'application/x-www-form-urlencoded' } 当前台请求为get时,在request请求中要加上 header:{ 'content-type':'applicatio
阅读全文
摘要:使用thinkphp5 写上传图片时,数据库存入的路径是uploads(该目录在public下),则显示图片的路径直接为../../数据库字段值即可
阅读全文
摘要:1. 判断是否为手机端(tp3) function ismobile() { // 如果有HTTP_X_WAP_PROFILE则一定是移动设备 if (isset ($_SERVER['HTTP_X_WAP_PROFILE'])) return true; //此条摘自TPM智能切换模板引擎,适合T
阅读全文
摘要:1. 页面刷新 window.location.reload();//页面刷新 2. 跨控制器引用该控制器的一个方法方法(thinkphp3) $weixin = A("Wxapi/Weixin"); $signPackage = $weixin -> getSignPackage(); 3. 去除
阅读全文
摘要:前端 html <div> <input type="text" id="phone" name="shouji" placeholder="请输入手机号"> <input type="button" style="float: right;color: #fff;width:40%;border-
阅读全文
摘要:<a href="javascript:void(0)" onclick="history.go(-1)">后退</a> >返回 上一页 返回另一个控制器内的页面 前台后台页面内内容获取 (前台) 积分兑换(前台) $('#morepay').click(function(){ var payid
阅读全文
摘要:(1) Url=>地址 (2) type=>请求方式(get或post) (3)timeout=>请求超时时间 (4) Async:true或false (5) data=>发送到服务器的数据 (6) dataType=>返回数据类型(xml,html,script,json,jsonp,text)
阅读全文
摘要:合并input框最好用浮动 $_SESSION 是全局变量(前台调用) $data只是页面内虚拟的数据 Empty标签用于判断某个变量是否为空 <empty name="name"> name为空 <else /> name不为空 </empty> 4. 标签内字符串的截取: |mb_substr
阅读全文
摘要:index.php?g=wap&m=other&a=search g=>分组 m=>控制器 a=>方法
阅读全文
摘要:$where['vdoid']=array('neq','');//eq=>等于$video = M('new')->where($where)->order("id desc")->select();
阅读全文
摘要:前台页面 jQuery.ajax({ type: "get", url: Apiurl+"user/userinfo", dataType: "json", data:{ 'userid':user,(用户id) }, //赋值给前台页面 success: function (arr) { $('#
阅读全文