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

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

最優(yōu)良人

2012/05/19 at 17:46

ie6下,浮動(dòng)的li里面文字不換行

在ie6下,浮動(dòng)的li里面文字在結(jié)尾出寬度不夠,但是不自動(dòng)換行,而是往下擠,使后面的li亂掉。

解決的方法是在li里面定義樣式 white-space: nowrap;

comments Comments (192)    -
2012/05/05 at 18:20

最簡(jiǎn)單的設(shè)為首頁,加入收藏代碼

只要一句代碼,可以實(shí)現(xiàn)設(shè)為首頁,加入收藏的功能,并且通用其他網(wǎng)站,自動(dòng)識(shí)別標(biāo)題和鏈接,不用手動(dòng)修改。但是只兼容ie瀏覽器。

<a href="#" onClick="this.style.behavior='url(#default#homepage)'; this.setHomePage(window.location.href);">設(shè)為首頁</a> | <a href="#" onClick="window.external.addFavorite(window.location.href,document.title)">加入收藏</a>

comments Comments (45)    -
2012/04/06 at 09:23

PHP刪除指定文件夾所有文件的方法

以下代碼實(shí)現(xiàn)刪除指定文件夾所有文件

$cacheDir = '../cache/runtime';
$dh = opendir($cacheDir);
while ( $file = readdir($dh) ) {

if (($file == '.') || ($file == '..')) { continue; }

if (file_exists( $cacheDir . '/' .$file)) {
if (!unlink($cacheDir . '/' . $file)) {
break;
}
}
}

標(biāo)簽:
comments Comments (12)    -
2012/03/14 at 11:05

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

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 = $GLOBALS['_CFG']['shop_title';
$ur_here = '<a href=".">' . $GLOBALS['_LANG']['home'] . '</a>';
2,ECSHOP底部隨機(jī)出現(xiàn)版權(quán)信息去除方法
第一步:刪除該函數(shù)即可,該函數(shù)位置:js/common.js
第244行函數(shù)如下:
onload = function()
{
var link_arr = document.getElementsByTagName(String.fromCharCode(65));
var link_str;
var link_text;
var regg, cc;
var rmd, rmd_s, rmd_e, link_eorr = 0;
var e = new Array(97, 98, 99,
100, 101, 102, 103, 104, 105, 106, 107, 108, 109,
110, 111, 112, 113, 114, 115, 116, 117, 118, 119,
120, 121, 122
);

try
{
for(var i = 0; i < link_arr.length; i++)
{
link_str = link_arr.href;
if (link_str.indexOf(String.fromCharCode(e[22], 119, 119, 46, e[4], 99, e[18], e[7], e[14],
e[15], 46, 99, 111, e[12])) != -1)
{
if ((link_text = link_arr.innerText) == undefined)
{
throw "noIE";
}
regg = new RegExp(String.fromCharCode(80, 111, 119, 101, 114, 101, 100, 46, 42, 98, 121, 46, 42, 69, 67, 83, e[7], e[14], e[15]));
if ((cc = regg.exec(link_text)) != null)
{
if (link_arr.offsetHeight == 0)
{
break;
}
link_eorr = 1;
break;
}
}
else
{
link_eorr = link_eorr ? 0 : link_eorr;
continue;
}
}
} // IE
catch(exc)
{
for(var i = 0; i < link_arr.length; i++)
{
link_str = link_arr.href;
if (link_str.indexOf(String.fromCharCode(e[22], 119, 119, 46, e[4], 99, 115, 104, e[14],
e[15], 46, 99, 111, e[12])) != -1)
{
link_text = link_arr.textContent;
regg = new RegExp(String.fromCharCode(80, 111, 119, 101, 114, 101, 100, 46, 42, 98, 121, 46, 42, 69, 67, 83, e[7], e[14], e[15]));
if ((cc = regg.exec(link_text)) != null)
{
if (link_arr.offsetHeight == 0)
{
break;
}
link_eorr = 1;
break;
}
}
else
{
link_eorr = link_eorr ? 0 : link_eorr;
continue;
}
}
} // FF

try
{
rmd = Math.random();
rmd_s = Math.floor(rmd * 10);
if (link_eorr != 1)
{
rmd_e = i - rmd_s;
link_arr[rmd_e].href = String.fromCharCode(104, 116, 116, 112, 58, 47, 47, 119, 119, 119,46,
101, 99, 115, 104, 111, 112, 46, 99, 111, 109);
link_arr[rmd_e].innerHTML = String.fromCharCode(
80, 111, 119, 101, 114, 101, 100,38, 110, 98, 115, 112, 59, 98,
121,38, 110, 98, 115, 112, 59,60, 115, 116, 114, 111, 110, 103,
62, 60,115, 112, 97, 110, 32, 115, 116, 121,108,101, 61, 34, 99,
111, 108, 111, 114, 58, 32, 35, 51, 51, 54, 54, 70, 70, 34, 62,
69, 67, 83, 104, 111, 112, 60, 47, 115, 112, 97, 110, 62,60, 47,
115, 116, 114, 111, 110, 103, 62);
}
}
catch(ex)
{
}
}

這是隨機(jī)在底部產(chǎn)生版權(quán)的函數(shù),刪掉就可以了!!
直接把這個(gè)函數(shù)去掉,底部的Powered by ECShop 就沒了
第二步,打開themes/default/library/ 這里default為你當(dāng)前的主題,找到page_footer.lbi,里面內(nèi)容全部刪掉,添加上你想添加的代碼。支持html代碼的。完畢。

第三步,如果你只想簡(jiǎn)單的改下就弄第一步就行,然后去\languages\zh_cn 找common.php找到ecshop.com改成你網(wǎng)址,E CSho p對(duì)應(yīng)改成你的網(wǎng)站名稱就行,最后去themes\default\images里把logo1.gif改成你想要的圖片,也就是左下角的那張.

 

 

修改ecshop后臺(tái)的版權(quán)信息
在languages/zh_cn/admin/common.php文件修改
admin/templates/index.htm

Line 4

*/
<title>{$lang.cp_home}</title>

將下部版權(quán)修改為自己的
/*

admin/templates/login.htm

Line 4

*/

<title>{$lang.cp_home}</title>
刪除<img src="images/login.png" width="178" height="256" border="0" alt="ECSHOP" />

/*

admin/templates/top.htm

Line 132

Line 135

*/

刪除圖片<img src=”images/ecshop_logo.gif” alt=”ECSHOP - power for e-commerce” />

刪除<li><a href=”index.php?act=about_us” target=”main-frame”>{$lang.about}</a></li>
刪除<li><a href="javascript:web_address();">{$lang.help}</a></li>
/*

admin/templates/start.htm

將{$lang.ecs_version}修改為:網(wǎng)站版本

Line 6

*/

<script type=”text/javascript” src=”http://api.ecshop.com/checkver.php?ver={$ecs_version}&lang={$ecs_lang}&release={$ecs_release}&php_ver={$sys_info.php_ver}&mysql_ver={$sys_info.mysql_ver}&ocount={$order.stats.oCount}&oamount={$order.stats.oAmount}&gcount={$goods.total}&charset={$ecs_charset}” ></script>
/*

Line 184-195

*/

<tr>
<td>{$lang.ecs_version}</td>
<td>{$ecs_version} RELEASE {$ecs_release}</td>
<td>{$lang.install_date}</td>
<td>{$install_date}</td>
</tr>
<tr>
<td>{$lang.ec_charset}</td>
<td>{$ecs_charset}</td>
<td></td>
<td></td>
</tr>
/*

admin/tempaltes/pageheader.htm

Line 24

*/

<span class=”action-span1″><a href=”index.php?act=main”>{$lang.cp_home}</a> {if $ur_here} - {$ur_here} {/if}</span>
/*

admin/templates/pagefooter.htm

Line 3

*/

{$lang.copyright}
/*

admin/templates/menu.htm

Line 143

*/

<script language=”JavaScript” src=”http://api.ecshop.com/menu_ext.php?charset={$charset}&lang={$help_lang}”></script>
admin/templates/filecheck.htm
將{$lang.filecheck_tips_step1}修改:為文件校驗(yàn)是針對(duì) 原始網(wǎng)站文件 為基礎(chǔ)進(jìn)行核對(duì),點(diǎn)擊下面按鈕開始進(jìn)行校驗(yàn)。
admin\includes\inc_menu.php
刪除:
$modules['11_system']['shp_webcollect'] = 'webcollect.php';
$modules['11_system']['shop_authorized'] = 'license.php?act=list_edit';
也可以刪除$modules['13_backup']['convert'] = 'convert.php?act=main';
admin\sms_url.php
將$url = 'http://service.shopex.cn/sms/index.php?certificate_id='.$certi_id.'&sess_id='.$sess_id.'&auth='.$auth.'&ac='.$ac;
的連接修改掉或刪除 這個(gè)是申請(qǐng)短信連接的地址
includes\modules
下所有文件中的 ECSHOP TEAM 和其連接刪除

 

 

 

ecshop 后臺(tái)管理左側(cè)菜單添加新欄目
先說幾個(gè)相關(guān)文件admin 文件下admin/includes/inc_menu.php

languages\zh_cn\admin\common.php

admin/includes/common.php

接下來說添加的方法,首先

先在languages\zh_cn\admin\common.php添加欄目的名字,關(guān)于這個(gè)是添加后臺(tái)在頁面顯示所需的文字的文件

打開看看,再看看模板就明白了

然后在admin/includes/common.php文件中添加一級(jí)欄目的數(shù)字名字就數(shù)組

再在admin/includes/inc_menu.php 文件中添加對(duì)應(yīng)的二級(jí)欄目的數(shù)組鏈接

鏈接為一級(jí)的數(shù)組元素,不明白的話,最好先看看這兩個(gè)文件

然后說怎樣實(shí)現(xiàn)在分配權(quán)限里面管理它,

打開admin/includes/inc_priv.php文件

新建欄目權(quán)限數(shù)組 數(shù)組元素和admin/includes/inc_menu.php頁面的數(shù)組相同,對(duì)應(yīng)的值自定義

并比自定義的該值添加的表ecs_admin_action表中

首先在表中新建你的一級(jí)欄目parent_id 為0 action_code 為數(shù)組元素的名字

然后添加二級(jí)欄目的 信息 parent_id為你的一級(jí)菜單的action_id

action_code 為打開admin/includes/inc_priv.php文件中 自定義的值

好了,就樣你就添加的一個(gè)后臺(tái)管理欄目,并可在新建管理后進(jìn)行權(quán)限管理

標(biāo)簽:
comments Comments (84)    -
2012/03/08 at 14:56

CSS border-collapse 屬性,細(xì)邊線table表格樣式

border-collapse 屬性設(shè)置表格的邊框是否被合并為一個(gè)單一的邊框,還是象在標(biāo)準(zhǔn)的 HTML 中那樣分開顯示。

可能的值

描述
separate 默認(rèn)值。邊框會(huì)被分開。不會(huì)忽略 border-spacing 和 empty-cells 屬性。
collapse 如果可能,邊框會(huì)合并為一個(gè)單一的邊框。會(huì)忽略 border-spacing 和 empty-cells 屬性。
inherit 規(guī)定應(yīng)該從父元素繼承 border-collapse 屬性的值。

細(xì)邊線table表格樣式

table {width:100%; border:1px solid #ccc; border-collapse:collapse;}
table td {border:1px solid #ccc; border-collapse:collapse; padding:10px 15px; color:#999;}

標(biāo)簽:, ,
comments Comments (374)    -
2012/03/07 at 11:34

prompt彈出對(duì)話框,獲取輸入的值

定義和用法

prompt() 方法用于顯示可提示用戶進(jìn)行輸入的對(duì)話框。

語法

prompt(text,defaultText)

text 可選。要在對(duì)話框中顯示的純文本(而不是 HTML 格式的文本)。
defaultText 可選。默認(rèn)的輸入文本。也可以不輸入值,如果不輸入值,則返回null。

說明

如果用戶單擊提示框的取消按鈕,則返回 null。如果用戶單擊確認(rèn)按鈕,則返回輸入字段當(dāng)前顯示的文本。   在用戶點(diǎn)擊確定按鈕或取消按鈕把對(duì)話框關(guān)閉之前,它將阻止用戶對(duì)瀏覽器的所有輸入。在調(diào)用 prompt() 時(shí),將暫停對(duì) JavaScript 代碼的執(zhí)行,在用戶作出響應(yīng)之前,不會(huì)執(zhí)行下一條語句。

以下的代碼彈出一個(gè)對(duì)話框,用戶輸入密碼,然后提交表單
 function fn_check( theForm )
  {
	var m = prompt ( "請(qǐng)輸入新密碼" , "" ) ;
	if ( m )
	{
		m = trimString(m);
		if ( m != "" )
		{
			theForm.newftppassword1.value = m;
			theForm.doftppasswordupdate.value = '1';
			theForm.submit();
			return true;
		}
	}
	return ;
  }
<form id="frm_sitedetail" name="frm_sitedetail" action="siteadmin.php" method="POST">
		<input type="hidden" name="newftppassword1" value="">
<input type="hidden" name="doftppasswordupdate" value="">
</form>
標(biāo)簽:,
comments Comments (267)    -
2012/02/24 at 17:31

CSS hack之!important;下劃線,星號(hào)

星號(hào)" * " :ie6 ie7支持 hirefox不支持

下劃線"_":ie6支持 ie7 firefox不支持

!important; : firefox ie7支持 ,ie6部分支持

IE6支持重定義中的!important,例如:   .yuanxin {color:#e00!important;}   .yuanxin {color:#000;}   你將會(huì)發(fā)現(xiàn)定義了樣式class="yuanxin"時(shí),在IE下,字體顯示為紅色(#e00)。   但不支持同一定義中的!important。例如:   .yuanxin {color:#e00!important;color:#000}   此時(shí)在IE6下不支持,你將會(huì)發(fā)現(xiàn)定義了樣式class="yuanxin"時(shí),字體顯示為黑色(#000)。

 

HTML頭部引用(if IE)Hack:針對(duì)所有IE:<!--[if IE]><!--您的代碼--><![endif]-->,針對(duì)IE6及以下版本:<!--[if lt IE 7]><!--您的代碼--><![endif]-->,這類Hack不僅對(duì)CSS生效,對(duì)寫在判斷語句里面的所有代碼都 會(huì)生效。

選擇器Hack:比如 IE6能識(shí)別*html .class{},IE7能識(shí)別*+html .class{}或者*:first-child+html .class{}。等等

瀏覽器優(yōu)先級(jí)別:FF<IE7<IE6,CSS hack書寫順序一般為FF IE7 IE6

以: " #demo {width:100px;} "為例;

#demo {width:100px;} /*被FIREFOX,IE6,IE7執(zhí)行.*/

* html #demo {width:120px;} /*會(huì)被IE6執(zhí)行,之前的定義會(huì)被后來的覆蓋,所以#demo的寬度在IE6就為120px; */

*+html #demo {width:130px;} /*會(huì)被IE7執(zhí)行*/ ---------------

所以最后,#demo的寬度在三個(gè)瀏覽器的解釋為:

FIREFOX:100px;

ie6:120px;

ie7:130px;

IE8 最新css hack:

"\9" 例:"border:1px \9;".這里的"\9"可以區(qū)別所有IE和FireFox.

"\0" IE8識(shí)別,IE6、IE7不能.

IE6 hack

_background-color:#CDCDCD; /* ie 6*/

IE7 hack

*background-color:#dddd00; /* ie 7*/

IE8 hack

background-color:red\0; /* ie 8/9*/

IE9 hack

background-color:blue\9\0;

標(biāo)簽:,
comments Comments (287)    -
2012/02/24 at 17:25

絕對(duì)定位的div顯示在屏幕中間

使用絕對(duì)定位position: absolute;定義元素時(shí),可以用top,bottom,left,right控制元素在頁面上下左右的位置,有時(shí)我們需要元素?zé)o論頁面大小都是顯示在頁面中間時(shí),可以使用百分比來定義,如

#purr-container {
position: absolute;
top: 50%;
right: 50%;
z-index: 99999999 !important;
}

注: !important;ie7和FF可以識(shí)別,ie6不識(shí)別,可以用來區(qū)分火狐和ie6

comments Comments (409)    -
2012/02/10 at 09:07

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

1 概述

ab(ApacheBench)是Apache自帶的超文本傳輸協(xié)議(HTTP)性能測(cè)試工具。 其設(shè)計(jì)意圖是描繪當(dāng)前所安裝的Apache的執(zhí)行性能, 主要是顯示你安裝的Apache每秒可以處理多少個(gè)請(qǐng)求。

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)證信息。用戶名和密碼之間由一個(gè)":"隔開,并將被以base64編碼形式發(fā)送。無論服務(wù)器是否需要(即是否發(fā)送了401認(rèn)證需求代碼),此字符串都會(huì)被發(fā)送。
-c concurrency
一次產(chǎn)生的請(qǐng)求個(gè)數(shù)。默認(rèn)是一次一個(gè)。
-C cookie-name=value
對(duì)請(qǐng)求附加一個(gè)"Cookie:"頭行。其典型形式是 name=value 的一個(gè)參數(shù)對(duì)。此參數(shù)可以重復(fù)。
-d
不顯示"percentage served within XX [ms] table"消息(為以前的版本提供支持)。
-e csv-file
產(chǎn)生一個(gè)逗號(hào)分隔(CSV)文件,其中包含了處理每個(gè)相應(yīng)百分比請(qǐng)求(從1%到100%)所需要的相應(yīng)百分比時(shí)間(以微秒為單位)。由于這種格式已經(jīng)"二進(jìn)制化",所以比"gnuplot"格式更有用。
-g gnuplot-file
把所有測(cè)試結(jié)果寫入一個(gè)"gnuplot"或者TSV(以Tab分隔)文件。此文件可以方便地導(dǎo)入到 Gnuplot, IDL, Mathematica, Excel中。其中的第一行為標(biāo)題。
-h
顯示使用方法的幫助信息。
-H custom-header
對(duì)請(qǐng)求附加額外的頭信息。此參數(shù)的典型形式是一個(gè)有效的頭信息行,其中包含了以冒號(hào)分隔的字段和值(如:"Accept-Encoding: zip/zop;8bit")。
-i
執(zhí)行HEAD請(qǐng)求,而不是GET 。
-k
啟用KeepAlive功能,即在一個(gè)HTTP會(huì)話中執(zhí)行多個(gè)請(qǐng)求。默認(rèn)不啟用KeepAlive功能。
-n requests
在測(cè)試會(huì)話中所執(zhí)行的請(qǐng)求個(gè)數(shù)。默認(rèn)僅執(zhí)行一個(gè)請(qǐng)求,此時(shí)其結(jié)果不具有意義。
-p POST-file
包含了POST數(shù)據(jù)的文件。
-P proxy-auth-username:password
對(duì)一個(gè)中轉(zhuǎn)代理提供基本認(rèn)證信息。用戶名和密碼由一個(gè)":"隔開,并將被以base64編碼形式發(fā)送。無論服務(wù)器是否需要(即是否發(fā)送了407代理認(rèn)證需求代碼),此字符串都會(huì)被發(fā)送。
-q
如果處理的請(qǐng)求數(shù)大于150,ab每處理大約10%或者100個(gè)請(qǐng)求時(shí),會(huì)在stderr輸出一個(gè)進(jìn)度計(jì)數(shù)。此 -q 標(biāo)記可以屏蔽這些信息。
-s
用于編譯中(ab -h 會(huì)告訴你)使用了SSL的受保護(hù)的https ,而不是http協(xié)議的時(shí)候。此功能是實(shí)驗(yàn)性的,最好不要用。
-S
不顯示中值和標(biāo)準(zhǔn)偏差值,而且在均值和中值為標(biāo)準(zhǔn)偏差值的1到2倍時(shí),也不顯示警告或出錯(cuò)信息。默認(rèn)時(shí),會(huì)顯示最小值/均值/最大值等數(shù)值。(為以前的版本提供支持)
-t timelimit
測(cè)試所進(jìn)行的最大秒數(shù)。內(nèi)部隱含值是"-n 50000"。它可以使對(duì)服務(wù)器的測(cè)試限制在一個(gè)固定的總時(shí)間以內(nèi)。默認(rèn)時(shí),沒有時(shí)間限制。
-T content-type
POST數(shù)據(jù)時(shí)所使用的"Content-type"頭信息。
-v verbosity
設(shè)置顯示信息的詳細(xì)程度,4或更大值會(huì)顯示頭信息,3或更大值可以顯示響應(yīng)代碼(404,200等),2或更大值可以顯示警告和其他信息。
-V
顯示版本號(hào)并退出。
-w
以HTML表格形式輸出結(jié)果。默認(rèn)時(shí),它是白色背景的兩列寬度的一張表。
-x <table>-attributes
設(shè)置<table>屬性的字符串。此屬性被填入<table 這里 > 。
-X proxy[:port]
對(duì)請(qǐng)求使用代理服務(wù)器。
-y <tr>-attributes
設(shè)置<tr>屬性的字符串。
-z <td>-attributes
設(shè)置<td>屬性的字符串。

以上參數(shù)最常用的是-n 在測(cè)試會(huì)話中所執(zhí)行的請(qǐng)求個(gè)數(shù);和-c 一次同時(shí)產(chǎn)生的并發(fā)請(qǐng)求個(gè)數(shù)。

2.3 實(shí)例

假設(shè)我們要測(cè)試一下本網(wǎng)站,其中一個(gè)性能測(cè)試用例是:“同時(shí)處理50個(gè)并發(fā)請(qǐng)求并運(yùn)行 100 次index.php 首頁”,我們可以在cmd shell中輸入 ab -n 1000 -c 50 http://www.dgkai.cn/index.php,運(yùn)行結(jié)束后,ab會(huì)自動(dòng)顯示測(cè)試結(jié)果,如下:

C:\wamp\Apache2\bin>ab -n 100 -c 50 http://www.dgkai.cn/index.php
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/

Benchmarking www.dgkai.cn (be patient).....done
Server Software: Apache/2.0.52
Server Hostname: www.dgkai.cn
Server Port: 80

Document Path: /index.php
Document Length: 21380 bytes

Concurrency Level: 50
Time taken for tests: 66.328125 seconds
Complete requests: 100
Failed requests: 15
(Connect: 0, Length: 15, Exceptions: 0)
Write errors: 0
Non-2xx responses: 15
Total transferred: 1856980 bytes
HTML transferred: 1822145 bytes
Requests per second: 1.51 [#/sec] (mean)
Time per request: 33164.063 [ms] (mean)
Time per request: 663.281 [ms] (mean, across all concurrent requests)
Transfer rate: 27.33 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 31 41 8.5 46 62
Processing: 32 20242 9776.5 22015 43890
Waiting: 31 1637 1327.6 1156 6078
Total: 78 20283 9778.3 22046 43921

Percentage of the requests served within a certain time (ms)
50% 22046
66% 24812
75% 26656
80% 27796
90% 30421
95% 30734
98% 31921
99% 43921
100% 43921 (longest request)

C:\wamp\Apache2\bin>

以上結(jié)果指出,在并發(fā)50個(gè)請(qǐng)求的情況下,完成100次的訪問請(qǐng)求,共花了66.328125秒,這個(gè)程序每秒可處理1.51個(gè)請(qǐng)求。

2.4 問題

在實(shí)際使用中,我發(fā)現(xiàn)-c 參數(shù),即一次同時(shí)產(chǎn)生的并發(fā)請(qǐng)求個(gè)數(shù)最多設(shè)置成64,大于等于65就會(huì)報(bào)錯(cuò),不知道為什么。

標(biāo)簽:, , ,
comments Comments (205)    -
2012/02/08 at 14:28

php生成二維碼

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 libqrencode C library,
provides API for creating QR Code barcode images (PNG, JPEG thanks to GD2).
Implemented purely in PHP, with no external dependencies (except GD2 if needed).

地址:http://phpqrcode.sourceforge.net/
下載:http://sourceforge.net/projects/phpqrcode/

3.libqrencode

地址:http://fukuchi.org/works/qrencode/index.en.html
php支持請(qǐng)參考:http://hirokawa.netflowers.jp/entry/4900/

4.QRcode Perl CGI & PHP scripts
地址:http://www.swetake.com/qr/qr_cgi.html

標(biāo)簽:
comments Comments (20)    -