摘要:
function getwh(e){ var a=new Array() var t=e.offsetTop; var l=e.offsetLeft; var w=e.offsetWidth; var h=e.offsetHeight; while(e=e.offsetParent){ t+=e.offsetTop; l+=e.offsetLeft; } a[0]=w;a[1]=h return a;
}ie 9,8,7,6 ff 7 8工作都正常,不错的代码 阅读全文
摘要:
记录用户通过常见的搜索引擎搜索关键词,进入你网站的情况的代码$rfr = $_SERVER['HTTP_REFERER'];//if(!$rfr) $rfr='http://'.$_SERVER['HTTP_HOST'];if($rfr){ $p=parse_url($rfr); parse_str($p['query'],$pa); $p['host']=strtolower($p['host']); $arr_sd_key=array( 'baidu.com'=>' 阅读全文
摘要:
function ob_gzip($content)
{ if( !headers_sent() && extension_loaded("zlib") && strstr($_SERVER["HTTP_ACCEPT_ENCODING"],"gzip")) { $content = gzencode($content." \n",9); header("Content-Encoding: gzip"); header("Vary: Accept-Enco 阅读全文
摘要:
zend1.1.1 在php 5.3.8环境下,目前支持sql 的pdo连接方式有问题,需要修改:1 Zend\Db\Adapter\Pdo\Mssql.php: $_pdoType为->protected $_pdoType = 'sqlsrv';2 Zend\Db\Adapter\Pdo\Abstract.php 的_connect函数protected function _connect() { // if we already have a PDO object, no need to re-connect. if ($this->_connec... 阅读全文
摘要:
最近做一个项目, 用的是php 5.3.8, 数据库是sql server 2008,sql server的管理器,针对每个字段的东西很多,写个注释都要拉滚动条,每写一个得拉一下,非常麻烦.所以写了一个程序,通过网页列出表和字段,直接可以在网页上写注释,方便多了<?php /* Connect to the local server using Windows Authentication and
specify the AdventureWorks database as the database in use. */
$serverName = "(local)" 阅读全文
摘要:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=u 阅读全文
摘要:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>获取某个城市的经度纬度</title>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=1.2"></script>
&l 阅读全文
摘要:
vi /etc/sysctl.conf编辑文件,加入以下内容:net.ipv4.tcp_syncookies = 1net.ipv4.tcp_tw_reuse = 1net.ipv4.tcp_tw_recycle = 1net.ipv4.tcp_fin_timeout = 30然后执行/sbin/sysctl -p让参数生效。net.ipv4.tcp_syncookies = 1表示开启SYN Cookies。当出现SYN等待队列溢出时,启用cookies来处理,可防范少量SYN攻击,默认为0,表示关闭;net.ipv4.tcp_tw_reuse = 1表示开启重用。允许将TIME-WAIT 阅读全文
摘要:
8年PHP,懂点内核, 能写PHP扩展,5年网站经历,3年webgame经历,找个兼职有需要的留言手机网站, as, j2me,c#都会点点cms系统不会,没用过 阅读全文
摘要:
更简单,更好的办法是使用 simplexml_load_string,一个函数就可以轻松解决问题,而且,效果很好!下面的东西,还是看看吧class xml { private $parser; private $tag_cur=0; private $data=array(); private $struct=array(); function xml() { $this->parser = xml_parser_create(); xml_set_object($this->parser,&$this); xml_set_element_handler($this-> 阅读全文