複製代碼 代碼如下:<?php //----顯示上一篇、下一篇文章代碼 START---- $sql_former = "select * from article where id<$id order by id desc "; //上一篇文章sql語句。注意是倒序,因為返回結果集時只用了第一篇文章,而不是最後一篇文章 $sql_later = "select * from article where id>$id "; //下一篇文章sql語句
你可以通過增加一個設定檔,然後將需要禁止的一些 IP 位址通過一定規則添加到設定檔中,在程式初始化的時候,讀取設定檔中的每個規則,然後通過本文提供的方法去檢查當前訪問的用戶端 IP 位址是否存在於這些規則中,如果存在,則拒絕提供服務。 複製代碼 代碼如下:<?php /** * PHP 中檢查或過濾 IP 位址 * * 支援 IP 區間、CIDR(Classless Inter-Domain Routing)及單個 IP 格式 * 整理:http://www.CodeBit.cn *
比較簡潔的方法:建立一個目錄將phpmyadmin中的檔案複製到這個目錄中,iis中設定一下路徑。安裝好PHPmyAdmin後,在IE裡訪問時會出現下面的這種錯誤: Warning: require_once(./libraries/common.inc.php) [function.require-once]: failed to open stream: No such file or directory in X:xxxxxxphpmyadminindex.php on line 34
還是感覺5.2及以前的版本配置比較方便,使用5.3配置後,我的apache居然掛了,不知道問題出在哪裡,沒找到解決方案,最後只能ghost還原了一下。第一步:iis6.0環境配置,這裡不多介紹 第二步:下載php5.3.3的windows壓縮版本:php-5.3.3-nts-Win32-VC9-x86.zip1、:http://windows.php.net/download/,選擇VC9 x86 Non Thread
在網上下載了一個類比登陸discuz論壇的php程式範例,試運行時出現“Call to undefined function curl_init”這個錯誤提示,沒有定義的函數,也就是php還沒開啟對curl_init函數的支援。Google了一番終於解決了,方法如下: 以windows下的php+apache為例。 首先,開啟php.ini,找到“extension=php_curl.dll”,然後去掉前面的“;”注釋,重啟apache即可。
APC的介紹 The Alternative PHP Cache (APC) is a free and open opcode cache for PHP. Its goal is to provide a free, open, and robust framework for caching and optimizing PHP intermediate code. APC官方網站:http://www.php.net/manual/en/book.apc.php