PHP Two-dimensional code generator

Source: Internet
Author: User

PHP Two-dimensional code generator

(1) Download the PHP QR Code Library on the official website , download the source files and extract them to the Phpqrcode directory.

(2) Create a script file create_png.php Add the user form on the page with the following code:

<form method= "POST" >

input text:<inputtype= "text" name= "info" ><br>

Please select size:<selectname= ' Size ' >

<?

for ($i =1; $i <=10; $i + +) {// perform ten cycles

if ($i ==4) {// default status is 4

echo "<optionvalue=". $i. "' Selected> ". $i." </option> ";

}elese{

echo "<optionvalue=". $i. "' > ". $i." </option> ";

}

}

?>

</select>

<input type= "Submit" value= ' generate and display ' id= ' input ' >

</form>

(3) continue to add PHP operation code on the page as follows:

<?php

Inlcude_once ('..   /phpqrcode/qrlib.php '); introducing the External class library

if ($_post[' info ')} {// receive the value of the form

$temp = './images/'; define the path of the two-dimensional code picture

$filename =time (). "              Test.png "; Generate picture name

$filename = $temp. $filename; Build a full catalog

QRCode::p ng ($_post[' info '), $filename, "L", $_post[' size ');// Create two-dimensional code based on parameters

echo " "; Show Pictures

}

?>

refuse to be a waste wood, I will do genius! receive PHP learning materials


PHP Two-dimensional code generator

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.