Time of Update: 2016-07-25
/*** 根據IP地址取得城市名稱 純真IP資料庫* edit: bbs.it-home.org*/ function convertip($ip) { //IP資料檔案路徑 $dat_path = 'QQWry.Dat'; //檢查IP地址 if(!filter_var($ip, FILTER_VALIDATE_IP)) { return 'IP Address Error'; } //開啟IP資料檔案 if(!$fd =
Time of Update: 2016-07-25
分享一個php實現的圖片處理類,可以設定文字浮水印與圖片浮水印等,有需要的朋友參考下。本節分享一個圖片處理類,簡單實現了文字浮水印與圖片浮水印,是學習php圖片操作的小例子。代碼:image = new Imagick($tplImage); } /** * 設定文字屬性 * * @param string $sText text to print on the image (i.e. Buy 1 Get 1 Free ) * @param integer $x
Time of Update: 2016-07-25
if ($conn=OCILogon("kai","fjelite","linux")){ echo "SUCCESS ! Connected to database/n";}else{echo "Failed :-( Could not connect to database/n";}$stmt = OCIParse($conn,"select tel,AREA from hkh_tel "); OCIDefineByName($stmt,"TEL",&$TEL);
Time of Update: 2016-07-25
/*** date函數格式化輸出指定範圍的時間* by bbs.it-home.org*/$stand = "2013-01-"; for ($i = 1; $i $time = strtotime($stand . $i); $date[] = date("Ymd", $time); } print_r($date); ?>複製代碼實現效果:附,date函數擷取前一天或後一天日期例子: //日期定義 $day = date("Ymd", strtotime(
Time of Update: 2016-07-25
/** * 檢測訪問的ip是否為規定的允許的ip * Enter description here ... */ function check_ip(){ $ALLOWED_IP=array('192.168.2.*','127.0.0.1','192.168.2.49'); $IP=getIP(); $check_ip_arr= explode('.',$IP);//要檢測的ip拆分成數組 #限制IP if(!in_array($IP,
Time of Update: 2016-07-25
/** * 儲存網頁檔案到本地(用於採集圖片) * edit: bbs.it-home.org * @param 檔案路徑 $sUrl * @param 儲存本地路徑 $sSavePath * @return boolean */ function download_file($sUrl,$sSavePath='') { $sFileName = GetUrlFileExt($sUrl); $c = file_get_contents($sUrl);
Time of Update: 2016-07-25
$im = imagecreate(200,150);echo $im;?>//輸出Resource id #1複製代碼二,magecreatetruecolor - 建立一個真彩色的畫布1,格式:imagecreatetruecolor ( int x_size, int y_size )2,解析:同imagecreate一樣,建立一個空白的畫布,區別在於這個函數建立的畫布支援的色彩數更多,所以效果更好,傳入畫布寬度和高度的像素值,返回的是系統分配給這塊畫布的id號,例如: $im =
Time of Update: 2016-07-25
header("Content-type:application/vnd.ms-excel");header("content-Disposition:filename=downloaded.pdf ");echo"1\t 2\t 3\n"; //其中 \t 是空白 ,\n是斷行符號 (編碼規範 不能直接輸出)echo"1\t 2\t 3\n";echo"1\t 2\t 3\n";?> 複製代碼此時開啟這個php檔案,就會提示下載。也可以以table表格的方式輸出;
Time of Update: 2016-07-25
/*** 匯出帶有樣式的excel* edit:bbs.it-home.org*/include 'Writer.php'; /* *** 準備匯出的資料 *** */ $head = 'One Week Schedule'; $data = array('Monday' => array( array('time' => '09:00', 'event' => '公司例會例會'),
Time of Update: 2016-07-25
/*** 匯出csv檔案,header函數樣本* edit: bbs.it-home.org*/header( "Cache-Control: public" );header( "Pragma: public"
Time of Update: 2016-07-25
/** Cookies class 儲存,讀取,更新,清除cookies資料。可設定首碼。強制逾時。資料可以是字串,數組,對象等。 * Date: 2013-12-22 * Author: fdipzone * Ver: 1.0 * Edit: bbs.it-home.org* Func: * public set 設定cookie * public get 讀取cookie * public update
Time of Update: 2016-07-25
//快速Mysql的大資料備份//使用前請首先按照代碼注釋修改要匯入的SQL檔案名稱、資料庫主機名稱、資料庫使用者名稱、密碼、資料庫名。//同時將資料庫檔案和文本一起ftp導網站目錄,然後以WEB方式訪問此檔案即//edit:
Time of Update: 2016-07-25
複製代碼------解答-------- 第二個沒有做過,關注此問題。 第三個問題: 最簡單的,可以執行mysqldump命令。 $database="";//備份的資料庫名稱$user="";//資料庫連接使用者名稱$password="";//資料庫密碼$outputfile="";//匯出的備份的SQL檔案路徑 system($mysqldump." -u".$user." -p".$password." ".$database." > ".$outputfile."");?>複製代碼--
Time of Update: 2016-07-25
[mysql][client]socket = /tmp/mysql.sock#在這裡寫上mysql.sock的正確位置,通常不是在 /tmp/ 下就是在 /var/lib/mysql/ 下複製代碼2、修改串連方式:指定IP地址,使用tcp方式串連mysql,而不使用本地sock方式 #mysql -h127.0.0.1 -uuser -ppassword複製代碼3、建立連結為 mysql.sock 加個連結,比如說實際的mysql.sock在 /tmp/ 下,則鍵入命令: #ln -s
Time of Update: 2016-07-25
介紹下php中上傳大檔案的配置方法,就一些php上傳參數進行說明,瞭解如何在php中實現大檔案上傳的辦法,有需要的朋友參考下。php檔案上傳需要用到的參數: 幾個參數調整: 0:檔案上傳時存放檔案的臨時目錄。必須是 PHP 進程所有者使用者可寫的目錄。如果未指定則 PHP 使用系統預設值 php.ini檔案中upload_tmp_dir用來說明PHP上傳的檔案放置的臨時目錄。 要想上傳檔案,需要保證伺服器沒有關閉臨時檔案和有對檔案夾的寫入權限1:max_execution_time 變數max_
Time of Update: 2016-07-25
/** * 重新導向瀏覽器到指定的 URL * php頁面跳轉代碼 * @param string $url 要重新導向的 url * @param int $delay 等待多少秒以後跳轉 * @param bool $js 指示是否返回用於跳轉的 JavaScript 代碼 * @param bool $jsWrapped 指示返回 JavaScript 代碼時是否使用 標籤進行封裝 * @param bool
Time of Update: 2016-07-25
file_uploads = On ;開啟檔案上傳選項 upload_max_filesize = 500M ;上傳檔案上限複製代碼如果要上傳比較大的檔案,僅僅以上兩條還不夠,還需要把伺服器緩衝上限調大,把指令碼最大執行時間變長。如下: post_max_size = 500M ;post上限 max_execution_time = 1800 ; Maximum execution time of each script, in seconds指令碼最大執行時間 max_input_time
Time of Update: 2016-07-25
//字串壓縮舉例$string =“http://bbs.it-home.org is php technical website.This website is personal website.php8848.com has many php and mysql or other IT knowledage articles,so welcome to php8848.com!please enjoy it! it’s our honor if php8848 can help you !”
Time of Update: 2016-07-25
#如果提示The requested URL returned error: 404,請自行換成最新的版本 rpm -ivh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm rpm -ivh http://download.Fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm複製代碼步驟 2.
Time of Update: 2016-07-25
RewriteEngine On RewriteBase / RewriteRule ^/(.*)$ link.php?url=$1[L]複製代碼實現了將 http://t.cn/link.php?url=zHEYrvV 轉換為了 http://t.cn/zHEYrvV ,縮短了不少,那麼如何通過 zHEYrvV 去尋找到 http://bbs.it-home.org/sitejs-17300-1.html