浏览器中无法显示,但是已经生成了图片文件。求助下~ #######################
1
Uni9k OP ##<?php
include 'phpqrcode.php'; $value = $_GET['url'];//二维码内容 $errorCorrectionLevel = 'L';//容错级别 $matrixPointSize = 6;//生成图片大小 //生成二维码图片 QRcode::png($value, 'qrcode.png', $errorCorrectionLevel, $matrixPointSize, 2); $QR = 'qrcode.png';//已经生成的原始二维码图 //输出图片 Header("Content-type: image/png"); imagepng($QR); imagedestroy($QR); ?>## |
2
oott123 2016-04-15 19:32:06 +08:00
不是很懂你 imagepng('qrcode.png'); 是怎么想的。
不考虑并发,按你这个思路,这个代码应该是: header("Content-Type: image/png"); readfile('qrcode.png'); 但是你要考虑并发的话,你这个思路不太对。 |
3
oott123 2016-04-15 19:33:52 +08:00
Usage
To install simply include: qrlib.php for full version (also you have to provide all library files form package plus cache dir) OR phpqrcode.php for merged version (only one file, but slower and less accurate code because disabled cache and quicker masking configured) Then use it as follows: QRcode::png('code data text', 'filename.png'); // creates file QRcode::png('some othertext 1234'); // creates code image and outputs it directly into browser --- via http://phpqrcode.sourceforge.net/ 注意我复制的最后一行。 |