不使用submit按钮来提交表单
<script language="javascript"> function gosubmit(){ document.myfrom.submit(); } </script> <form name="myfrom" method="post" action="post.php"> <input type="text" name="username" /> <span onclick="gosubmit()">提交</sp...
json_encode()转码中文显示不正常解决办法
php5.4以上版本. json_encode($data,JSON_UNESCAPED_UNICODE)
chrome谷歌浏览器下input内text不垂直居中解决办法
加入样式 input { font:16px "Microsoft YaHei", arial; /font:16px arial;/ height:35px; line-height:35px\9; _line-height:36px; width:300px;; padding-left:4px; border:1px solid #ccc; }
让nginx支持ThinkPHP3.2.2的URL重写并可通过网址访问
server { listen 80; server_name www.xingdong365.com; location / { #root /usr/share/nginx/html; root /data/www/xingdong365/; index index.html index.htm index.php; if (!-e $request_filename) { rewrite ^/(.*)$ /ind...
网页中css去除滚动条
<body scroll="no">
php获得字符串内字符的个数(包含中文)
function getstrlen($str,$charset="utf-8") { $re['utf-8'] = "/[\x01-\x7f]|[\xc2-\xdf][\x80-\xbf]|[\xe0-\xef][\x80-\xbf]{2}|[\xf0-\xff][\x80-\xbf]{3}/"; $re['gb2312'] = "/[\x01-\x7f]|[\xb0-\xf7][\xa0-\xfe]/"; $re['gbk'] = "/[\x01-\x7f]|[\x...
php截取字符串函数(兼容中文或中英文字符串)
function msubstr($str, $start=0, $length, $charset="utf-8", $suffix=true) { if(function_exists("mb_substr")) $slice = mb_substr($str, $start, $length, $charset); elseif(function_exists('iconv_substr')) { $slice = iconv_substr($str,$star...
php加密解密(异或,base64,des)
前几天给pc端写接口用到数据加密,现在总结下,当时主要做的是对pc端传来的数据进行解密,现在用php模拟下加密以及解密 1.加密 第一步:先进行异或加密,然后在base64加密 function my_jiami($str){ //随机取8位数 for($i=0;$i<8;$i++){ $key.= rand(0,9); } $tmp=""; for($i=0;$i<strlen($str);$i++){ $tmp.=substr($...
网站后台ifarme下session失效后点击跳转到登陆页
<script type="text/javascript"> MyIndex = '{:U(MODULE_NAME."/Login/index")}';//为跳转链接 if (top.location != self.location){ top.location = MyIndex; } </script>
php获取本周,上周,本月,上月,本季度日期代码
$startweek = "本周开始时间:".date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-date("w")+1-7,date("Y"))); $endweek = "本周结束时间:".date("Y-m-d H:i:s",mktime(23,59,59,date("m"),date("d")-date("w")+7-7,date("Y"))); echo $startweek; echo "<br>"; echo $endweek; echo "<br>";...