久艹网,亚洲一日韩欧美中文字幕2019,国产欧美日韩精品专区黑人,一区二区三区久久99

中山php|最優(yōu)網(wǎng)絡(luò)中山做網(wǎng)站 中山php建站

最優(yōu)良人

Category Page for: 后端程序

ecshop前后臺去掉版權(quán)powered by信息

2012/03/14 at 11:05 » Comments (84)

1,去除標(biāo)題power by ecshop 在 include/lib_main.php 里面找到 function assign_ur_here($cat = 0, $str = ''){ ....} 大概在142行 $page_title = $GLOBALS['_CFG']['shop_title']. ' - ' . 'Powered by ECShop'; $ur_here = '<a href=".">' . $GLOBALS['_LANG']['home'] . '</a>'; 把上面改成: $page_title ...more »

Apache自帶的ab(ApacheBench)性能測試工具對網(wǎng)站進(jìn)行訪問壓力測試

2012/02/10 at 09:07 » Comments (205)

1 概述 ab(ApacheBench)是Apache自帶的超文本傳輸協(xié)議(HTTP)性能測試工具。 其設(shè)計(jì)意圖是描繪當(dāng)前所安裝的Apache的執(zhí)行性能, 主要是顯示你安裝的Apache每秒可以處理多少個請求。 2 使用 2.1 安裝 Apache服務(wù)器套件自帶ab,只要安裝Apache即可,無需另行安裝ab。ab位于%ApacheHome%/bin目錄下(“%ApacheHome%”為Aapche安裝路徑),你也可以把a(bǔ)b.exe文件copy出來,獨(dú)立使用。 2.2 參數(shù)列表 -A auth-username:password 向服務(wù)器提供基本認(rèn)證信息。用戶名和密碼之間由一個":"隔開,并將被以base64編碼形式發(fā)送。無論服務(wù)器是否需要(即是否發(fā)送了401認(rèn)證需求代碼),此字符串都會被發(fā)送。 -c concurrency 一次產(chǎn)生的請求個數(shù)。默認(rèn)是一次一個。 -C cookie-name=value 對請求附加一個"Cookie:"頭行。其典型形式是 name=value 的一個參數(shù)對。此參數(shù)可以重復(fù)。 -d 不顯示"percentage served within XX [ms] table"消息(為以前的版本提供支持)。 -e csv-file 產(chǎn)生一個逗號分隔(CSV)文件,其中包含了處理每個相應(yīng)百分比請求(從1%到100%)所需要的相應(yīng)百分比時間(以微秒為單位)。由于這種格式已經(jīng)"二進(jìn)制化",所以比"gnuplot"格式更有用。 -g gnuplot-file 把所有測試結(jié)果寫入一個"gnuplot"或者TSV(以Tab分隔)文件。此文件可以方便地導(dǎo)入到 ...more »

php生成二維碼

2012/02/08 at 14:28 » Comments (20)

php生成二維碼可以有以下幾種方式 1.google開放api $urlToEncode="http://bbs.lewanchina.com"; generateQRfromGoogle($urlToEncode); function generateQRfromGoogle($chl,$widhtHeight ='150',$EC_level='L',$margin='0') { $url = urlencode($url); echo '<img src="http://chart.apis.google.com/chart?chs='.$widhtHeight.'x'.$widhtHeight.'&cht=qr&chld='.$EC_level.'|'.$margin.'&chl='.$chl.'" alt="QR code" widhtHeight="'.$size.'" widhtHeight="'.$size.'"/>'; } 2.php類庫PHP QR Code PHP QR Code is open source (LGPL) library for generating QR Code, 2-dimensional barcode. Based on ...more »

smarty模版函數(shù)含多參數(shù)的使用規(guī)則

2012/02/01 at 17:38 » Comments (359)

  模板中調(diào)用變量時,當(dāng)只有一個參數(shù)是,就直接{$str1|函數(shù)名},當(dāng)有函數(shù)有兩個參數(shù)時,{第一個參數(shù)|函數(shù)名:第二個參數(shù)},當(dāng)有三個參數(shù)時,{第一個參數(shù)|函數(shù)名:第二個參數(shù):第三個參數(shù)},,當(dāng)有4,5,,,參數(shù)時,以此類推。 smarty在模板上可以直接使用php自帶的函數(shù),甚至可以使用自定義的函數(shù)。 smarty使用date函數(shù)的用法是{{'Y-m-d'|date:$var}}   more »

php file_get_contents函數(shù)分段讀取大記事本或其它文本文件

2011/12/22 at 11:39 » Comments (263)

當(dāng)我們遇到文本文件體積很大時,比如超過幾十M甚至幾百M(fèi)幾G的大文件,用記事本或者其它編輯器打開往往不能成功,因?yàn)樗麄兌夹枰盐募?nèi)容全部放到內(nèi)存里面,這時就會發(fā)生內(nèi)存溢出而打開錯誤,遇到這種情況我們可以使用PHP的文件讀取函數(shù)file_get_contents()進(jìn)行分段讀取。 函數(shù)說明 string file_get_contents ( string $filename [, bool $use_include_path [, resource $context [, int $offset [, int $maxlen ]]]] ) 和 file() 一樣,只除了 file_get_contents() 把文件讀入一個字符串。將在參數(shù) offset 所指定的位置開始讀取長度為 maxlen 的內(nèi)容。如果失敗,file_get_contents() 將返回 ...more »

讓wamp安裝包中的PHPMyadmin在外網(wǎng)也可以訪問

2011/12/16 at 10:20 » Comments (265)

修改一下phpmyadmin讓外部也可以訪問,打開路徑:X:\wamp\Apache2\conf\alias\ 其中X為您安裝WAMP軟件的磁盤路徑, 編輯phpmyadmin.conf 配置文件,找到Options Indexes FollowSymLinks MultiViews AllowOverride all Order Deny,Allow Deny from all Allow from 127.0.0.1修改為Options Indexes FollowSymLinks MultiViews AllowOverride allOrder Allow,Deny Allow from all 完成修改后,保存退出,重新啟動WAMP,或直接在軟件單擊左鍵>>>選擇重新啟動所有服務(wù) 重新啟動服務(wù)后,局域網(wǎng)內(nèi)的機(jī)器在瀏覽器地址欄輸入安裝有WAMP軟件的機(jī)器的IP 地址就可以訪問了 more »

PHP預(yù)定義常量(內(nèi)部常量)DIRECTORY_SEPARATOR,PHP_VERSION,PHP_OS

2011/10/11 at 14:08 » Comments (2,738)

DIRECTORY_SEPARATOR 是PHP內(nèi)部常量,表示路徑分隔符 在win里為\ ,在linux 里為/PHP_VERSION這個內(nèi)建常量是 PHP 程序的版本,如 '3.0.8-dev'。PHP_OS這個內(nèi)建常量指執(zhí)行 PHP 解析器的操作系統(tǒng)名稱,如 'Linux'。預(yù)定義常量表內(nèi)核預(yù)定義常量這些常量在 PHP 的內(nèi)核中定義。它包含 PHP、Zend 引擎和 SAPI 模塊。 PHP_VERSION (string) PHP_OS (string) PHP_SAPI (string) 自 PHP 4.2.0 起可用。參見 php_sapi_name()。 PHP_EOL (string) 自 ...more »

php生成excel或者word文檔最簡單的方法

2011/09/29 at 16:29 » Comments (3,306)

以下代碼實(shí)現(xiàn)簡單輸出表格或者word文檔,如生成一個兩列的excel文檔,改動相應(yīng)文件頭為 header("Content-type:application/vnd.msword"); header("Content-Disposition:filename=test.doc"); 就可以輸出.doc .xls等文件格式了 header("Content-type:application/vnd.ms-excel"); header("Content-Disposition:filename=test.xls"); echo "test1\t"; echo "test2\t\n"; //兩列之后換行 echo "test1\t"; echo "test2\t\n"; echo "test1\t"; echo "test2\t\n"; echo "test1\t"; echo "test2\t\n"; echo "test1\t"; echo "test2\t\n"; echo "test1\t"; echo "test2\t\n"; 附一個文件格式對應(yīng)的數(shù)組 $mime_types = array( 'gif' => 'image/gif', 'jpg' => 'image/jpeg', 'jpeg' => 'image/jpeg', 'jpe' => 'image/jpeg', 'bmp' => 'image/bmp', 'png' => 'image/png', 'tif' => ...more »

php獲取訪問者操作系統(tǒng)

2011/09/29 at 16:25 » Comments (258)

function osinfo() { $os=""; $Agent = $GLOBALS["HTTP_USER_AGENT"]; if (eregi('win',$Agent) && strpos($Agent, '95')) { $os="Windows 95"; } elseif (eregi('win 9x',$Agent) && strpos($Agent, '4.90')) { $os="Windows ME"; } elseif (eregi('win',$Agent) && ereg('98',$Agent)) { $os="Windows 98"; } elseif (eregi('win',$Agent) && eregi('nt 5\.0',$Agent)) { $os="Windows 2000"; } elseif (eregi('win',$Agent) ...more »

php獲取訪問者瀏覽器

2011/09/29 at 16:24 » Comments (5)

以下函數(shù)實(shí)現(xiàn)返回瀏覽者所使用的瀏覽器 function browse_infor() { $browser="";$browserver=""; $Browsers =array("Lynx","MOSAIC","AOL","Opera","JAVA","MacWeb","WebExplorer","OmniWeb"); $Agent = $GLOBALS["HTTP_USER_AGENT"]; for ($i=0; $i<=7; $i++) { if (strpos($Agent,$Browsers[$i])) { $browser = $Browsers[$i]; $browserver =""; } } if (ereg("Mozilla",$Agent) && !ereg("MSIE",$Agent)) { $temp =explode("(", $Agent); $Part=$temp[0]; $temp =explode("/", $Part); $browserver=$temp[1]; $temp =explode(" ",$browserver); $browserver=$temp[0]; $browserver =preg_replace("/([\d\.]+)/","\\1",$browserver); $browserver = ...more »