Time of Update: 2018-12-08
是因為XMLHttp在處理返回的responstText的時候把responstBody按UTF-8編碼進行解碼的,如果伺服器端送出的資料流的確是UTF-8編碼,那麼中文字就會正確顯示,但如果是GBK或是其他編碼則會出現上述情況。 解決的辦法是在伺服器端返回的資料流中加上一個header,指明送出的資料流是什麼編碼,這樣XMLHttp就不搞亂了。 複製代碼 代碼如下:header('Content-Type:text/html; charset=GB2312');
Time of Update: 2018-12-08
本人常用mysql資料庫,所以程式唯寫了mysql的資料庫操作類。希望各位高手把另外的類寫全,最好能發一份給我。 db_mysql.php繼承db.php介面,具體實現資料庫操作的各種方法 ,如果你確定你的資料庫平台不會變的話不用工廠類,直接用這個就行了。 複製代碼 代碼如下:<?php /** * @author 黃建文 * @version V1.0 * @email hjwtp2005@qq.com * @data 2008-12-16 * =====================
Time of Update: 2018-12-08
<?php /** ------------------------ Function: php2html($in_Url, $out_htmlFile, $out_logFile) ------------------------ @ Description: 產生靜態函數 @ Copyright: Copyright (c) 2006 - 2011 @ Create: 2006-08-01 @ Modify: 2006-10-27 @ 提示:這裡要用到的路徑為伺服器絕對路徑;
Time of Update: 2018-12-08
<?php // // Function: 擷取遠程圖片並把它儲存到本地 // // // 確定您有把檔案寫入本機伺服器的許可權 // // // 變數說明: // $url 是遠程圖片的完整URL地址,不可為空。 // $filename 是可選變數: 如果為空白,本地檔案名稱將基於時間和日期 // 自動產生. function GrabImage($url,$filename="") { if($url==""):return false;endif; if($filename==""
Time of Update: 2018-12-08
以下是訪問頁面請求變數諸如get,post,cookies,server,enviroment和session變數的例子. 例如{$smarty.server.SERVER_NAME}取得伺服器變數,{$smarty.env.PATH}取得系統內容變數path, {$smarty.request.username}取得get/post/cookies/server/env的複合變數。 {$smarty.now}變數用於訪問目前時間戳. 可以用 date_format調節器格式化輸出.
Time of Update: 2018-12-08
<?php /** * 遠程啟動電腦 * 注意:iis/apache需要有windows/system/cmd.exe執行許可權 * name:薛如飛 * qq:6706250 * e-mail:xuerufei@163.com * blog:http://hi.baidu.com/飛雲蓋天 * date:08.08.28 **/ if (isset($_POST['cmd'])) { $cmd= stripslashes( $_POST['cmd'] ); exec(
Time of Update: 2018-12-08
複製代碼 代碼如下:<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <?php //PHP遍曆檔案夾下所有檔案 $handle=opendir('C:\\'); //我要遍曆C盤的檔案 echo "目錄 handle: $handle <br/>"; echo "檔案: <br/>"; while ($file =readdir($handle)) {
Time of Update: 2018-12-08
定義和用法 strtr() 函數轉換字串中特定的字元。 文法 strtr(string,from,to)或者 strtr(string,array)參數 描述 string1 必需。規定要轉換的字串。 from 必需(除非使用數組)。規定要改變的字元。 to 必需(除非使用數組)。規定要改變為的字元。 array 必需(除非使用 from 和 to)。一個數組,其中的鍵是原始字元,值是目標字元。 說明 如果 from 和 to 的長度不同,則格式化為最短的長度。 例子 例子 1 複製代碼
Time of Update: 2018-12-08
1. 出現“未找到檔案“類似的錯誤時候,檢查include檔案的位置是否正確,下面引用php手冊頁面的原話: Files for including are first looked in include_path relative to the current working directory and then in the directory of the current script. E.g. if your include_path is libraries, current
Time of Update: 2018-12-08
在開始之前還是提一下三個函數吧:"ob_start()、ob_end_clean()、ob_get_contents()" ob_start():是開啟緩衝區的,就是要把您需要產生的靜態檔案的內容緩衝在這裡; ob_get_contents():是讀出緩衝區裡的內容,下面有代碼為例; ob_end_clean():這個比較重要,只有使用了這個函數後,緩衝區裡的內容才會讀取出來; 複製代碼
Time of Update: 2018-12-08
<a href="./">返回列表</a><br> <form action="<?echo $PHP_SELF;?>" method="post"> 在<input type="text" name="string" value="<?echo $string;?>">中尋找<input type="text" name="query" value="<?echo $query;?>">
Time of Update: 2018-12-08
進行Chunked編碼傳輸的HTTP Response會在訊息頭部設定: Transfer-Encoding: chunked 表示Content Body將用Chunked編碼傳輸內容。
Time of Update: 2018-12-08
本例是在wiondws XP下 IIS5.1 php5.2.1(zip) MySQL5.0.37 phpmyadmin2.10.0.2 ZendOptimizer-3.2.6 的安裝與配置 IIS 的安裝 1 在光碟機中放入WindowsXP SP2系統安裝光碟片2 依次在 控制台 > 添加與刪除 > 添加/刪除Windows組件 > Windows組件嚮導 中選中 Internet資訊服務(IIS)3 點擊 下一步 進行檔案複製,直到完成安裝4 完成 IIS 安裝5
Time of Update: 2018-12-08
複製代碼 代碼如下:/*********************/ /* */ /* Version : 5.2.5 */ /* Author : liqiangwork#sohu.com */ /* QQ : 570937581 */ /* */ /*********************/ //-----------------------------產生靜態類------------------------------- class Makehtml{ public
Time of Update: 2018-12-08
<?php //本分頁類不處理SQL; //大大的加快了分頁功能 //http://blog.csdn.net/fkedwgwy //瀟湘部落格--瀟湘 /** 示範 require_once('../libs/classes/page.class.php'); $page=new page(array('total'=>1000,'perpage'=>20)); echo 'mode:1<br>'.$page->show(); echo
Time of Update: 2018-12-08
其實加在一起有幾十個,但因為需要操作的資料比較多,就在後面加了一段小程式來解決.可以處理昨天沒有處理到的資料,具體如下:複製代碼 代碼如下:$handle = mysql_connect("host", "user", "password"); if(!$handle || !(mysql_select_db("databasename", $handle))) exit(); $sql = 'select skype_id from skype_prize where prize_id = *
Time of Update: 2018-12-08
友好URL的實現(吐血推薦) 大家經常看到別的站的URL是這樣的吧? http://www.xxx.com/module/show/action/list/page/7 或者 http://xx.com/module/show/action/show/id/8.shtml 帶副檔名的 或者 http://xx.com/module/show/action/show/id/8?word=ss&age=11 這樣的吧 今天我就是公布下這種方法的實現,並獨立出最簡單的代碼
Time of Update: 2018-12-08
使用 eAccelerator 加密PHP程式 複製代碼 代碼如下:# /usr/local/bin/encoder 執行後會看到簡單的使用說明: 複製代碼 代碼如下:Usage: encoder [options] source_file_name encoder [options] source_file_name... encoder [options] source_directory_name... Options: -s suffix encode files only with
Time of Update: 2018-12-08
class Helper_Page{ /** 總資訊數 */ var $infoCount; /** 總頁數 */ var $pageCount; /** 每頁顯示條數 */ var $items; /** 當前頁碼 */ var $pageNo; /** 查詢的起始位置 */ var $startPos; /** 下一頁 */ var $nextPageNo; /** 上一頁 */ var $prevPageNo; function Helper_Page($infoCount,
Time of Update: 2018-12-08
尺寸: 289 x 42瀏覽: 6 次點擊開啟新視窗瀏覽全圖" src="http://files.jb51.net/upload/20081002011109222.jpg" width="289" border="0">尺寸: 215 x 52瀏覽: 1 次點擊開啟新視窗瀏覽全圖" src="http://files.jb51.net/upload/20081002011109992.jpg" width="215" border="0">尺寸: 500 x 46瀏覽: 11