春与秋
春有百花秋有月,夏有凉风冬有雪;若无闲事挂心头,便是人间好时节。
春与秋
当前位置: 首页 >

PHP

帝国ecms升级为7.0后sql查询出错
PHP

在帝国cms的首页模板使用 [ecmsinfo]”select * from [!db.pre!]ecms_news where checked=1 order by diggtop desc,id desc limit 8″,8,30,0,24,21,0[/ecmsinfo] 来调用数据,原6.6正常显示,升级后出错, SQL Error: select * from ***_ecms_news where checked=1 order by ...

短网址绑定二级目录的htaccess文件
PHP

绑定在二级目录url. # .htaccess main domain to subdirectory redirect # Copy and paste the following code into the .htaccess file # in the public_html folder of your hosting account # make the changes to the file according to the instructions. # Do not change this lin ...

wordpress表格样式
PHP WordPress

wordpress的表格样式真的不好,当然用插件可以解决这个问题,因平时表格用得少,不想使用插件,所以用以下代码解决. <style type=”text/css”> <!– table.table { border-spacing:2px; border-collapse:separate; background-color:#FFF; border-color:#FF990 ...

使用Jquery实现回车键Enter切换焦点等同于tab
PHP

在IE,Firefox,Chrome上测试通过。 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.3/jquery.min.js" type="text/javascript"></script> <div> <input type="text" ID="tb1" class="cls&quo ...

IE,FireFox,Chrome浏览器的keyCode
PHP

<body onkeydown="(function(e){if (!e) e = window.event;switch (e.keyCode | e.which | e.charCode) {case 13:alert('囧');break;}})(event);"></body>  

JavaScript的document汇总
PHP

<pre> document.title //设置文档标题等价于HTML的<title>标签 document.bgColor //设置页面背景色 document.fgColor //设置前景色(文本颜色) document.linkColor //未点击过的链接颜色 document.alinkColor //激活链接(焦点在此链接上)的颜色 document.vlinkColor ...

html input text 得到焦点后自动全选
PHP

自动全选 onfocus=”this.select()” onmouseover=”this.focus()” 按一下全选 onfocus=”this.select()” 例:<input type=”text” name=”t1″ size=”10″ 语法放这里>

运算符号乘除的长度
PHP

在用字符函数substr截取”×÷”时显示乱码,一直以为是编码问题,没想到这也是中文字符,得用mb_sbustr函数来截取,后面要加编码方式,这个点也老是忘…. <?php //测试时文件的编码方式要是UTF8 $str=’中文a字1符’; echo strlen($str).'<br>’;//14 ...

javascript 文本框定位、移动
PHP

定位: document.getElementById(“b1″).style.position=”absolute”; document.getElementById(“b1″).style.top=”10px”; 移动: document.getElementById(“b1”).style.left=document.getElementById(“b1″).offse ...

php 打印及打印预览
PHP

1、js实现(可实现局部打印) <input id=”btnPrint” type=”button” value=”打印” onclick=”javascript:window.print();” /> <input id=”btnPrint” type=”button” value=”打印预览” onclick=preview(1) /> <style type=”text/css” media=print> .noprint{display : none } </style> <p class=”noprint”>不需要打印的地方</p>