Input text: Input text:

Home  >  Article  >  Backend Development  >  PHP QR code generator

PHP QR code generator

巴扎黑
巴扎黑Original
2016-11-12 09:42:191824browse

PHP QR Code Generator

(1) Download the PHP QR Code class library from the official website, download the source file and extract it to the phpqrcode directory.

(2) Create the script file create_png.php and add a user form on the page. The code is as follows:

Input text:

Please select the size:

(3) Continue to add PHP operations to the page The code is as follows:

inlcude_once('../phpqrcode/qrlib.php'); //Introducing an external class library

if($_POST['info']){ //Receive the form Value

$temp='./images/'; //Define the QR code image path

$filename=time()."test.png"; filename;                              // Generate a complete directory

QRcode::png($_POST['info'],$filename,"L",$_POST['size']);//Create a QR code based on parameters

echo" "; //Show pictures

}

?>

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
Previous article:PHP $_REQUESTNext article:PHP $_REQUEST