Time of Update: 2016-07-21
function ChgTitle($title) { $length = 46; if (strlen($title)>$length) { $temp = 0; for($i=0; $iif (ord($title[$i]) > 128) $temp++; if ($temp%2 == 0) $title = substr($title,0,$length)."..."; else $title = substr($title,0,$length+1)."..."; } return
Time of Update: 2016-07-21
安裝平台:Linux,Solaris版本:qmail-1.03安裝的機器: mail.mydomain.com軟體包:qmail-1.03 qmail基本系統ucspi-tcp-0.88 tcpsever服務程式daemontools-0.70 監視工具checkpassword-0.81 pop3驗證使用者的程式ezmlm-0.53 郵件轉寄vpopmail-4.9.6-1 虛擬域使用者pop3支援qmailadmin-0.35 虛擬域web管理autorespond-1.0.0
Time of Update: 2016-07-21
/*** 轉換為UNIX時間戳記*/function gettime($d) { if(is_numeric($d)) return $d; else { if(! is_string($d)) return 0; if(ereg(":",$d)) { $buf = split(" +",$d); $year = split("[-/]",$buf[0]); $hour = split(":",$buf[1]); if(eregi("
Time of Update: 2016-07-21
玩轉虛擬網域名稱◎+ . 不知道大家最近上網是否發現一個新現象,就是有一些網站開始提供“username@server”的虛擬網域名稱服務 (DNS)。由於“@”的魅力,大家紛紛申請,你或許會想:“如果我也能提供這種服務,該多好阿:)人氣肯定不錯!”本文將給大家揭開“@”的“神秘”面紗,讓大家都可以來“@”!(Do u @ today?)
Time of Update: 2016-07-21
$key = "This is supposed to be a secret key !!!"; function keyED($txt,$encrypt_key) { $encrypt_key = md5($encrypt_key); $ctr=0; $tmp = ""; for ($i=0;$i{ if ($ctr==strlen($encrypt_key)) $ctr=0; $tmp.= substr($txt,$i,1) ^
Time of Update: 2016-07-21
//Sign.php//系統適用於win2000$path="e:\\serv-u\\ServUDaemon.ini";//使用者檔案的路徑$fabu="e:\\web\\";//總web路徑if($add){$fp1=fopen($path,"r+");$str=fread($fp1, filesize($path));$fp=fopen($path,"a");flock($fp,3);$us="=".$userid;$start=strpos($str,$us);if($start)
Time of Update: 2016-07-21
來源:奧索網 案頭中心(四)資料顯示作者:elong 最後一步就是顯示了。 下面這個程式要通過參數來調用。 比如php.php?jpg=jpg 後面的jpg是表格名。記住一定要的呀,不然就不能運行了,會顯示程式出錯。 大家可以把下面這個程式改一下。這樣就可以更加美觀了。 以下是來源程式: 顯示 mysql_connect("localhost","使用者名稱","密碼") or die("無法聯結資料庫!"); $query="SELECT
Time of Update: 2016-07-21
//這個例子可以練習關於IMAP的函數//但是如果真的要寫WEBMAIL,那麼要考慮的東西就不止這些了……孤狼login.php3 if (!$PHP_AUTH_USER) { Header("WWW-authenticate: basic realm="郵件客戶檢查""); Header("HTTP/1.0 401 Unauthorized"); } else { $MYDIR=ereg_replace("/[^/]+$","",$PHP_SELF);
Time of Update: 2016-07-21
>create table stream (ip text,sTime int,visits int,info text);if($day$mlink=mysql_connect('localhost','ajax','xxxxxxx');//統計至今首頁被瀏覽的總次數$query="select SUM(visits) as tvisits from stream";$result=mysql_db_query('ajax',$query,$mlink);echo
Time of Update: 2016-07-21
來源:奧索網 案頭中心(一)建立資料庫作者:elong這是小弟第一次寫文章。不知道能不能發布呀。。我把程式寫出來是想要大家參考一下。如果有哪位高手能改出更好的程式, 請別忘了和我說一聲呀。 :P 來源程式的示範頁面在elong.oso.com.cn/desk/ 第一步建立資料庫: 我們就以OSO的資料庫為列說明一下。 先登入資料庫。然後在點自己的的資料庫名,就在左邊。 在輸入命令那兒輸入以下命令。 CREATE TABLE jpg ( id int(8) NOT NULL
Time of Update: 2016-07-21
example.php複製代碼 代碼如下:$conn = ociplogon("test","123456","test123"); include_once "pager.inc.php"; ?>複製代碼 代碼如下:/** 分頁測試開始 */ // {{{ 初始分頁對象 $pager = new pager(); /** 將 select id,name,age from test where age>20 order by id desc 拆分 */ $sqlArr =
Time of Update: 2016-07-21
$d_label=array("service"=>"有償服務","teach"=>"家教中心","union"=>"校園服務聯盟","job"=>"學生兼職","free"=>"資訊庫");$directory=$REQUEST_URI;while($directory!="/"){ $d_text=basename($directory); if(isset($d_label[$d_text])){$d_text=$d_label[$d_text];}
Time of Update: 2016-07-21
來源:奧索網 案頭中心(二)資料庫寫入作者:elong 一、以下是資料庫的寫入的html程式,你可以加入密碼功能。把密碼做成變數發入下面那個寫入的php程式。這樣就實現了密碼保護了: 資料庫 資料庫管理程式查看資料庫資料 改資料 二、然後是處理這個提交的php程式: 尋找 資料庫的資料 mysql_connect("localhost","使用者名稱","密碼") or die("無法聯結資料庫!"); $query="insert into $jpg
Time of Update: 2016-07-21
在PHP4.0中加入了對Session的支援,方便了我們很多程式,比如購物車等等! 在很多論壇中,Session也用於處理使用者的登陸,記錄下使用者名稱和密碼,使得使用者不必每次都輸入自己的使用者名稱和密碼!但是一般的Session的生命期有限,如果使用者關閉了瀏覽器,就不能儲存Session的變數了!那麼怎麼樣可以實現Session的永久生命期呢?
Time of Update: 2016-07-21
1)文本計數器$countfile="/count.txt"; //設定儲存資料的檔案if (!file_exists($countfile)){//判斷檔案是否存在exec( "echo 0 > $countfile");} $fp = fopen($countfile,"rw"); $length=filesize($countfile);$num = fgets($fp,$length); $num += 1; exec( "rm -rf $countfile");exec(
Time of Update: 2016-07-21
來源:奧索網 案頭中心(三)修改資料庫作者:elong 下面這個程式在你輸入id後就把那個id的資料列出來。然後你就可以修改後寫入了. 資料庫的資料更新 if(isset($id)) { if(!mysql_connect("localhost","使用者名稱","密碼")) {echo"無法聯結資料庫"; exit(); } if(isset($url)) { $query="update $jpg set id='$id',url='$url',mess='$mess',fromx='$
Time of Update: 2016-07-21
# -------------------------------------------------------- # 資料表的結構 'menu' # --------------------------------------------------------CREATE TABLE menu ( menu_id int(11) NOT NULL auto_increment, menu varchar(20) NOT NULL, menu_grade int(11) NOT NULL,
Time of Update: 2016-07-21
把GB碼轉換到UTF8,php中TTF支援UTF8編碼的非ASCII字元輸出.在分析這段代碼之後,發現可以實現中文與ASCII混合輸出圖象,這樣在我們操作圖象函數時可以更方便. 代碼如下: function gb2utf8($gb) { if(!trim($gb)) return $gb; $filename="gb2312.txt"; $tmp=file($filename); $codetable=array(); while(list($key,$value)=each($tmp))
Time of Update: 2016-07-21
使用的環境 先建立一個測試用的資料庫 接著建立一個ODBC連結 再建個測試用的PHP Script 咱們來測試吧 使用的環境本檔案主要是在Win32的環境下作說明, 您需要的是台跑Windows 9x/NT/2000的電腦, 並裝有任何一種web server和PHP3或PHP4, 且可正確執行PHP Script. 並有一種以上的SQL資料庫軟體, 例如:Access...本檔案以MS-Access資料庫來作說明, 其它種的資料庫端,
Time of Update: 2016-07-21
在windows平台上使用php+xslt1。到http://www.php.net下載php 4.0.62。將php-4.0.6-Win32.zip解壓到c:\php下3。在web server上配置好php3。拷貝dlls目錄下的下列四個檔案到windows\system(32)下expat.dll sablot.dll xmlparser.dll xmltok.dll4。修改php.ini修改extension_dir指向正確的extension目錄extension_dir =