解决php连接mssql的问题。“PHP Startup: Unable to load dynamic library...”

当在php.ini配置好连接php_mssql.dll和在ext目录增加对应的dll文件后,如果在error.log里面出现“PHP Startup: Unable to load dynamic library '..\\..\\php-5.2.14\\ext\\php_mssql.dll'”的问题时。我们可以这样解决:

1. 将这些依赖的dll拷贝到%windir%\system32下
2. 或者将PHP的安装目录添加到%PATH%中

如何添加系统环境变量呢?

进入控制面板并打开“系统”图标(开始 -> 设置 -> 控制面板 -> 系统)

...

阅读全文 »

04月04

DiscuzX1.5和X2的function_core.php有哪些差别?

1.updatesession 增加了cookie值ulastactivity优化

2.调整了getuserbyuid,去除了两处条left join,不在调用common_member_count和common_member_status的内容

3.优化了getuserprofile中$data内容获取,避开了不同状态下不必要的查询

4.增加了dintval()取整函数

5.dheader函数增加手机判断

6.增加了手机检测函数checkmobile()

7.lang()增加了手机语言处理,优化了插件语言脚本的加载(设置为了缓存方式),增加{_G/xxx/xxx/xxx/xxx}语言键值

8.checktplrefresh()增加了$targettplname

9.template()增加手机处理,在mobile/目录

10.loadcache()去除了$_G['perm']

11.cachedata()、save_syscache()优化了$isfilecache判断

12.优化了dgmdate()

13.优化block_get(),增加memory('get'...处理

14.增加dstrlen()长度检测函数

15.aidencode()增加$tid参数

16.调整getforumimg()中$key值的加密方式authcode()调整为md5()

17.rewritedata()、rewriteoutput()增加了home_blog、forum_archiver的重写,去除了all_script

18.增加了mobilereplace()、mobileoutput()

19.调整了output()

20.增加了output_replace(),为了配合调整output()、output_ajax()等

21.runhooks()增加了手机处理,增加了HOOKTYPE常量的定义

22.hookscript()中增加home的判断处理,HOOKTYPE来替代hookscript

23.hookscriptoutput()的优化和增加QQ浏览器的相关处理

24.pluginmodule()中的showmessage提示调整

25.checklowerlimit()代码结构简化调整,增加_checklowerlimit()函数

26.updatemembercount()代码结构简化调整,增加_updatemembercount()函数

27.checkusergroup()中的include_once调整为require_once

28.debuginfo()的queries次数调整

29.adshow()中的hookscript优化

30.showmessage()调整增加libfile('function/message')和dshowmessage()

31.submitcheck()增加QQ浏览器相关

32.multi()分页中增加手机翻页处理

33.censor()增加用户组控制url相关处理

34.censormod()增加url处理

35.runlog()调整writelog()来简化代码结构

36.dreferer()增加处理“'&”

37.ftpcmd()增加错误捕获

38.优化diconv转换函数,在能用内置函数的情况就不是用自定义的libfile('class/chinese')

39.增加了getstatus、setstatus函数

40.优化notification_add()函数

41.增加了manage_addnotify()函数

42.sendpm()增加返回操作

43.g_icon()进行了样式调整

44.getposttablebytid()增加了支持$tids (array())

45.调整getposttable(),去除getposttableid()、getcountofposts()、getfieldsofposts()、getallwithposts()

46.优化了insertpost()、updatepost()

47.getcount()进行了结果intval

48.forumperm()优化了认证项,不局限于只有6个认证项

49.manyoulog()进行了状态检测

50.增加了useractionlog()用户动作日志

51.增加了getuseraction()

52.增加了get_url_list() url处理,增加了iswhitelist()、checkurl()

53.增加了update_template_block()

54.对http_build_query函数进行判断处理,无则定义

55.增加getrelatedlink()

56.增加了connect_valid()、connect_get_sig()、connect_get_access_token()QQ互联函数

57.增加getattachtablebyaid()、getattachtableid()、getattachtablebytid()、getattachtablebypid()、getattachnewaid()附件相关函数

58.增加SEO相关函数get_seosetting()

59.增加了strreplace_strip_split()、get_title_page()、getimgthumbname()、updatemoderate()、userappprompt()


阅读全文 »

04月02

简化的if结构

php的if结构为:

if($condition){

     //do something...

}

其实我们可以简化她:

<?php
$needle = false;
!$needle && _e();
function ...

阅读全文 »

03月31

如何检测是否是蜘蛛访问呢?

我们可以根据useragent来判断。预先定义好蜘蛛spider的useragent和用户浏览器的useragent,然后进行匹配检测。 

function checkrobot($useragent = '') {

static $_spiders = 'Bot|Crawl|Spider|slurp|sohu-search|lycos|robozilla';
static $_browsers = 'MSIE|Netscape|Opera|Konqueror|Mozilla';


$useragent ...

阅读全文 »

03月31

1 2 3 4 5 6 7 8 9 ... 12