Home  >  Article  >  php教程  >  生成二维码

生成二维码

WBOY
WBOYOriginal
2016-06-06 19:35:111144browse

无详细内容 无 ?phpdefine('BBSURL','http://bbs.cnfol.com/forum.php?mod=viewthreadtid=');define('QRCODEIMG','/home/www/dz_x2/data/qrcode/');include "./phpqrcode/phpqrcode.php";//引入PHP QR库文件$tid = isset($_GET['tid'])?$_GET['tid']:'';$qrco

<?php
define('BBSURL','http://bbs.cnfol.com/forum.php?mod=viewthread&tid=');
define('QRCODEIMG','/home/www/dz_x2/data/qrcode/');
include "./phpqrcode/phpqrcode.php";//引入PHP QR库文件
$tid = isset($_GET['tid'])?$_GET['tid']:'';
$qrcode_img = QRCODEIMG.$tid.'.png';
if(file_exists($qrcode_img))
{	
	header("content-type:image/png");
	$im = imagecreatefrompng($qrcode_img);
	imagepng($im);
	exit();
}else{
	$value = BBSURL.$tid;
	$errorCorrectionLevel = "L";
	$matrixPointSize = "4"; 
	QRcode::png($value, $qrcode_img, $errorCorrectionLevel, $matrixPointSize);
	QRcode::png($value, false, $errorCorrectionLevel, $matrixPointSize);
	exit;
}



?>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn