December, 2009Archive for

php5.3 and mysqlnd old authentication issue

After upgrading to php5.3, i got this problem: Here is what i found: * php 5.3 now use a native extension to use mysql : mysqlnd * my database credential was old (4 years old maybe) and still use the old mysql authentication * mysqlnd needs the new 41bytes password The problem was easy to solve: First, open '/etc/my.cnf' in Linux or 'my.ini' in Windows, if you set 'old_passwords=1' before, please delete it. Then, reset the user's password:

Set up Zend Framework in windows

1. Download latest zend framework archive file, copy library\zend folders to  your project\library\zend or add include_path in php.ini include_path = ".;C:\EasyPHP\www\library" 2. Your Apache installation must have the mod_rewrite extension installed and configured. 3.You must also ensure that Apache is configured to support .htaccess files. This is usually done by changing the setting: AllowOverride None to AllowOverride All in your httpd.conf file.

提高Google Adsense广告相关度的技巧

Google AdSense广告通常会针对用户网页的内容自动显示广告,但AdSense可能并不清楚你网页上的哪些部门的内容更重要,如果用户通过手动添加一些 HTML代码的方式,突出或忽略网页中的某些部分,这在一定程度上可以引导AdSense抓取工具重点分析网页的某些部分或忽略某些部分,以提高广告的相 关度。 比如,用户想要强调网页上某部分,那么可以在这部门的前后增加下面两段HTML代码。 <!-- google_ad_section_start --> <!-- google_ad_section_end --> 将需要强调的部分放在这两段代码中间即可。 如果用户想要忽略掉从某处开始的信息,可以在那个位置前增加下面的HTML代码。 <!-- google_ad_section_start(weight=ignore) --> 经过这些处理后,AdSense广告的相关度就会得到一定的提高。 不过,如果用户页面的内容不足,那么有可能会因为没有广告内容而显示公益广告。

Useful Javascript Code

This function will remove any characters or punctuation which is not allowed in input.