Hacder's Lab
哥德疯了


php和js中的URLEncode 相关资料整理

July 5th, 2010 . by hacder

理解URLEncode:
URLEncode:是指针对网页url中的中文字符的一种编码转化方式,最常见的就是Baidu、Google等搜索引擎中输入中文查询时候,生成经过Encode过的网页URL。URLEncode的方式一般有两种一种是传统的基于GB2312的Encode(Baidu、Yisou等使用),一种是基于UTF-8的Encode(Google,Yahoo等使用)。本工具分别实现两种方式的Encode与Decode。
中文 -> GB2312的Encode -> %D6%D0%CE%C4
中文 -> UTF-8的Encode -> %E4%B8%AD%E6%96%87
阅读全文——共956字


echo “${${phpinfo()}}”;

February 16th, 2010 . by hacder

echo "${${phpinfo()}}";
执行一下,你看到了什么?
People who looked at this item also looked at…

阅读全文——共55字


关于 WordPress 不能上传rar类型文件

November 25th, 2009 . by hacder

今天上传文件的时候,才发现 wp 居然不能上传rar文件.一上传就提示:

 
File type does not meet security guidelines. Try another
阅读全文——共327字


Nginx下supesite discuz wordpress 的rewrite规则

November 21st, 2009 . by hacder

关于Nginx下supesite discuz wordpress 等的rewrite规则,实现静态化
 
//supesite
rewrite ^/([0-9]+)/spacelist(.+)$ /index.php?uid/$1/action/spacelist/type$2 last;
阅读全文——共1317字


在Ubuntu 8.04 上快速部署php环境

October 29th, 2008 . by hacder

今天,凌晨起来迁移论坛到新服务器,本来以为程序和附件都同步好了,只要再同步一下数据库就可以了
没想到起来的时候,才发现:还没部署好ph环境.够晕的
只好一边处理同步一边部署环境了,并略记如下,以提个醒:
环境说明: nginx/0.5.33 +PHP 5.2.4-2  + mysql  5.0.51a
阅读全文——共3461字


php header示例

October 20th, 2008 . by hacder

<?php
/*** Function: PHP header() examples (PHP)
** Desc: Some examples on how to use the header() function of PHPYou find a detailed tutorial at expertsrt.com (English) or at ffm.junetz.de (German).These is also a good help about caching at web-caching.com.
** Example: see below. <br/><br/><b>Tip:</b> You can use these sites to check your headers: <a href="http://web-sniffer.net/">web-sniffer.net</a>, <a href="http://www.delorie.com/web/headers.html">delorie.com</a> or <a href="http://www.forret.com/projects/analyze/">www.forret.com</a>.
阅读全文——共10字


关于memcache的一些资料

October 20th, 2008 . by hacder

1. memcached的基本设置:-p 监听的端口
-l 连接的IP地址, 默认是本机
-d start 启动memcached服务
-d restart 重起memcached服务
阅读全文——共1017字


榨干 PHP,不得不转的一篇PHP使用技巧!

October 10th, 2008 . by hacder

静态调用的成员一定要定义成 static    (PHP5 ONLY)
贴士:PHP 5 引入了静态成员的概念,作用和 PHP 4 的函数内部静态变量一致,但前者是作为类的成员来使用。静态变量和 Ruby 的类变量(class variable)差不多,所有类的实例共享同一个静态变量。
<?php   
class foo {   
阅读全文——共2168字


一个不错的函数

September 28th, 2008 . by hacder

<?php
print_r(get_defined_vars());
?>
People who looked at this item also looked at…
阅读全文——共21字


[转]关于php时区时间错误问题

September 9th, 2008 . by hacder

之前有一个遗留问题,就是echo date(“y-m-d h:i:s”,time())回来的时间总是与实际时间对不上,今天终于在网上找到了原因和解决方法,分享如下:
我补充一点,我按照下面提示的方法修改php.ini找不到date.timezone 这行,是不是就没办法了呢,当然不是啦,哈哈没有的话就自己加嘛,自己动手丰衣足食。我加了这样一句date.timezone = “PRC”,问题就搞定了,高兴一下.
从php5.1.0开始,php.ini里加入了date.timezone这个选项,默认情况下是关闭的
也就是显示的时间(无论用什么php命令)都是格林威治标准时间
阅读全文——共2036字


Page 1 of 3123»