1.請先到該網站下載檔案
http://www.swetake.com/qrcode/qr_cgi_e.html
2.將下載的檔案上傳到你的主機上
3.閱讀 readme
http://www.swetake.com/qrcode/README-e.txt
4.參數
qr_img.php?d=data[&e=(L,M,Q,H)][&s=int size][&v=(1-40)][&t=J]
[&m=(1-16)&n=(2-16)[&o=original data][&p=(0-255)]]
d : Data you want to encode to QRcode.
A special letter like ‘%’.space or 8bit letter must be URL-encoded.
You cannot omit this parameter.
e : Error correct level
You can set ‘L’,’M’,’Q’ or ‘H’.
If you don’t set,program selects ‘M’.
s : module size
This parameter is no effect in HTML mode.
You can set a number more than 1.
Image size depends on this parameter.
If you don’t set,program selects ‘4’ in PNG mode or ‘8’ in JPEG mode.
v : version
You can set 1-40.
If you don’t set,program automatically selects.
t : image type
You can set ‘J’,’H’ or other.
‘J’ : jpeg mode.
‘H’ : html mode.(for perl only)
Other : png mode.
If you don’t set,program select PNG mode.
修改 qr_img.php 最下方程式
[php]
<?php
/*
#— output image
#
*/
Header("Content-type: image/".$qrcode_image_type);
ImageCopyResized($output_image,$base_image,0,0,0,0,$qrcode_image_size,$qrcode_image_size,$mib,$mib);
if ($qrcode_image_type == "jpeg"){
//原本程式 ImageJpeg($output_image);
ImageJpeg($output_image,’./img/’.$qrcode_data_string.’.jpg’);//改這樣才能存檔
} else {
//原本程式 ImagePng($output_image);
ImagePng($output_image,’./img/’.$qrcode_data_string.’.png’);//改這樣才能存檔
//記得img這個資料夾的權限要開成777
}
?>
[/php]
[ PHP ] – 產生QR-Code
評等結果
點擊便能為這篇文章進行評等!
[評等總次數: 0,平均評等: 0]
評等結果
點擊便能為這篇文章進行評等!
[評等總次數: 0,平均評等: 0]
垃圾桶 家用 客廳 臥室 辦公室 衛生間 大容量 高顏值 創意 收納 垃圾
水壺背袋 水壺網袋 水瓶袋 多色可選 戶外郊遊 登山野餐 可放手機 水壺背帶
香積麵 藥膳 風味 84gx5包 素泡麵 純素 素食 蔬食 慈濟 靜思
現貨超低價 小新玩偶 蠟筆小新 動感新生活係列 潮玩 小新公仔
請問一下
如果我的d : 是類似這樣的方式該如何解決呢
http://localhost/a.php?a=1&b=2&c=3
跑出來的qrcode,只會秀出http://localhost/a.php?a=1
會遇到&就切掉了
因我不太會寫,可以教一下方式嗎,非常感謝你
你給d 的參數中有特殊字元 所以要先用 PHP urlencode 編碼過才可以
urlencode(‘http://localhost/a.php?a=1&b=2&c=3’);
& 字符在$_GET中是切割參數的依據所以你的網址如果沒有先編碼過就會只顯示到 &前面的資料