Below you will find pages that utilize the taxonomy term “PHP”
Posts
phalcon-devtools 增加專案樣板
phalcon-devtools 增加專案樣板
之前phpconf 有會眾提到說是否自行增加樣版?基本上不會有問題而且開發團隊有增加樣版也都還沒補上.
接下來會簡單講解如何加入自行樣板.
安裝使用phalcon-devtools[
]1
Posts
FreeBSD PHP4 PHP5 APACHE1 APACHE22 共存
說明現在公司因為支前專案採用PHP4 APACHE1.3 要轉換到PHP5 APACHE22 其中又不使服務中斷 只好再一台系統上同時安裝兩種 以下只說明 另外安裝的PHP5 APACHE22 安裝ap
Posts
php execl dde
<?<br /> $excel =new COM(“Excel.Application”)or die(“Unable to instanciate Excel”);<br /> print “Loaded excel,version {$excel->Version}n”;<br /> $excel->Visible =0;<br /> $book=$excel->Workbooks->open(“c://dde.xls”);<br /> $sheet=$book->Worksheets(“Sheet1”);<br /> $a=$excel->DDEInitiate(“Excel”,“c://dde.xls”);<br /> $c =$excel->DDEExecute($a,“A1:D1”);<br /> <span style=“display: none;“>(http://www.GetJetso.com - 著數網)</span> $Range=$sheet->Range(“A1:D1”);<br /> $cell=$Range->Cells(1,4);<br /> echo $cell->value;<br /> $excel->DDETerminate($a);<br /> $excel->Workbooks->Close();<br /> unset($excel);<br /> unset($a);<br /> ?>
Posts
ajax跟蹤文件上傳進度條
(文件來源 http://www.ibm.com/developerworks/cn/opensource/os-php-v525/index.html) 2007 年 6 月 08 日 PHP V5.2 為開發人員添加了 hook 以利用實時跟蹤文件上傳進度的功能。本文是 系列文章(共五部分)的第 5 部分,將向您展示如何監視文件
Posts
PHP MySQL Tips
Continuing from my earlier post on PHP performance, I thought I’d share a few Mysql tips that I’ve learnt over the years. Hope it helps someone and please leave a comment with your own tips or provide any corrections to the ones mentioned. Word searching 1.
SELECT * FROM TABLE WHERE MATCH (`field`) AGAINST ('Keyword') (Fastest)
2.
SELECT * FROM TABLE WHERE MATCH (`field`) AGAINST ('+Keyword' IN BOOLEAN MODE) (Fast)
Posts
IE中打開UTF-8編碼title為中文的網頁會顯示空白頁的問題
(忘了引用來源) 很久很久以前(大概2005年10月 ~2006年3月),當時在blogger.com寫Blog。當時blogger.com有中
Posts
利用imagemagick來作縮圖
<?php $w=”240″; //自行設定的縮圖寬度 $h=”320″; //自行設定的縮圖高度 if($_FILES[‘file’][‘type’]==”image/pjpeg” || $_FILES[‘file’][‘type’]==”image/gif” || $_FILES[‘file’][‘type’]==”image/png”) { if($_FILES[‘file’][‘type’]==”image/pjpeg”) { $filename=substr(rand(0,999999999999),1,7).”.gif”; //隨機取檔名..我的習慣啦 ^^|| } if($_FILES[‘file’][‘type’]==”image/gif”) { $filename=substr(rand(0,999999999999),1,7).”.gif”; } if($_FILES[‘file’][‘type’]==”image/png”) { $filename=substr(rand(0,999999999999),1,7).”.png”; } $size=$w.”x”.$h; copy($_FILES[‘file’][‘tmp_name’],”/home/caisse/case/kf/data/file/b”.$filename); //將暫存檔copy
Posts
亂數取碼當成驗證碼的問題
//此副程式的功能在於生成驗證碼圖片 //重設亂數種子 srand((double)microtime()*1000000); //產生一組6位數的數字 $abc=substr(md5(uniqid(rand())),mt_rand(0,15),6); //建立一個 80*30 畫素的圖形 $img = imagecreate(80,30); //設定顏色 $white = imageco
Posts
如何秀出複數的排序條件資料
SELECT * FROM Product ORDER BY SellDate DESC 因為資料的SellDate可能同時會有幾十筆都相同,我希望可以在篩選出這批資料後在更詳細的依照他們的編號去做排序…
Posts
PHP GooGle PageRank程式
<?php // Google PageRank Calculator function by ZeNiTRaM – version 0.1 // Licensed under the GPL License // eMail me at zenitram [AT] dubmail.net // Uses code from The Google Checksum Calculator, by Alex Stapleton, Andy Doctorow, Vijay “Cyberax” Bhatter, and a few others, licensed under the public domain (http://www.mobileread.com/forums/showpost.php?p=7769&postcount=87) and XMLize.php by Hans Anderson (http://www.hansanderson.com/php/xml/). // Use: $pagerank = GetPagerank(“http://www.google.es”); // GetPagerank returns a STRING with the Pagerank number
Posts
非mmcache!Memcached的應用:多網站伺服器 PHP 共享 Session
請注意是 Memcached 不是 mmcache,很多人搞不清楚他們兩個的不同!多半玩過 PHP 的人大概都聽過 mmcache,它是一個預編譯緩衝的 PHP 加速程式,能夠提升
Posts
FreeBSD 使用PHP 透過FTP連線拋檔 備份
<?php define(“FTP_TIMEOUT”,90); // FTP Statuscodes define(“FTP_COMMAND_OK”,200); define(“FTP_FILE_ACTION_OK”,250); define(“FTP_FILE_TRANSFER_OK”,226); define(“FTP_COMMAND_NOT_IMPLEMENTED”,502); define(“FTP_FILE_STATUS”,213); define(“FTP_NAME_SYSTEM_TYPE”,215); define(“FTP_PASSIVE_MODE”,227); define(“FTP_PATHNAME”,257); define(“FTP_SERVICE_READY”,220); define(“FTP_USER_LOGGED_IN”,230); define(“FTP_PASSWORD_NEEDED”,331); define(“FTP_USER_NOT_LOGGED_IN”,530); if (!defined(“FTP_ASCII”)) define(“FTP_ASCII”,0); if (!defined(“FTP_BINARY”)) define(“FTP_BINARY”,1); class FTP { var $passiveMode = TRUE; var $lastLines = array(); var $lastLine = “”; var $controlSocket = NULL; var $newResult = FALSE; var $lastResult = -1; var $pasvAddr = NULL; var $error_no = NULL; var $error_msg = NULL; function FTP() { } function connect($host, $port=21, $timeout=FTP_TIMEOUT)