quentin 的blog

What's the difference between VC9 and VC6 when you download PHP?

 

Which version do I choose?

If you are using PHP with Apache 1 or Apache2 from apache.org you need to use the VC6 versions of PHP

If you are using PHP with IIS you should use the VC9 versions of PHP

VC6 Versions are compiled with the legacy Visual Studio 6 compiler

VC9 Versions are compiled with the Visual Studio 2008 compiler and have improvements in performance and stability.

博客分类: 

PHPCMS验证码显示不出来的解决办法

今天遇到phpcms系统中验证码显示不了的情况,查了下资料,发现有2种情况。

我是通过,修改checkcode.php,include/common.inc.php和include/config.inc.php文件的编码格式为utf8解决了。

请参考:

http://bbs.phpcms.cn/thread-118224-1-1.html

http://bbs.phpcms.cn/viewthread.php?tid=94617&highlight=%D1%E9%D6%A4%C2%EB

博客分类: 

PHPCMS 2008内的采集功能乱码问题解决办法

最近在玩PHPCMS,发现其中内置采集模块挺强大的。不过,在PHPCMS(UTF8)版本里,只要采集的页面是GB2312编码的,数据都有乱码。

其实,在spider/admin/admin.inc.php中有这样一行:

//$charset_config = array('self'=>'gbk','target'=>'utf8');//GBK配置

$charset_config = array('self'=>'utf8','target'=>'gbk');//UTF8配置

self => 表示本身系统编码,

target => 表示取得的编码。

如果你是使用GBK版本的话,那么使用$charset_config = array('self'=>'gbk','target'=>'utf8');//GBK配置,如果是UTF8的话就是用$charset_config = array('self'=>'gbk','target'=>'utf8');//GBK配置

修改保存,问题解决啦。

 

博客分类: 

Google Static Map

使用静态Google Map的话,简单的使用如下:

Example:

http://maps.google.com/maps/api/staticmap?markers=31.199991,121.632299&zoom=16&size=400x400&sensor=false

markers的参数是经纬度,可以使用http://gmaps-samples.googlecode.com/svn/trunk/geocoder/singlegeocode.html 这个工具来确定( 很方便)。

比如:

http://maps.google.com/maps/api/staticmap?markers=32.106534,120.563235&zoom=12&size=400x400&sensor=false

 

待续(未完)

博客分类: 

浏览器缓存实现原理

浏览器缓存将文件保存在客户端,好的缓存策略可以减少对网络带宽的占用,可以提高访问速度,提高用户的体验,还可以减轻服务器的负担。因此我们有必要了解它的实现原理,用来提高网站的性能。
当一个客户端请求web服务器, 请求的内容可以从以下几个地方获取:服务器、浏览器缓存中或缓存服务器中。这取决于服务器端输出的页面信息。页面文件有三种缓存状态。
1.最新的:选择不缓存页面,每次请求时都从服务器获取最新的内容。
2.未过期的:在给定的时间内缓存,如果用户刷新或页面过期则去服务器请求,否则将读取本地的缓存,这样可以提高浏览速度。
3.过期的:也就是陈旧的页面,当请求这个页面时,必须进行重新获取。

页面的缓存状态是由http header决定的,一个浏览器请求信息,一个是服务器响应信息。主要包括Pragma: no-cache、Cache-Control、 Expires、 Last-Modified、If-Modified-Since。其中Pragma: no-cache由HTTP/1.0规定,Cache-Control由HTTP/1.1规定。

Cache-Control的主要参数

博客分类: 

页面