Php QR code generation support logo (phpqrcode)

Source: Internet
Author: User
According to the official phpqrcode version, download the phpqrcode official version and put api. php in it. How can I use the domain name phpqrcodeapi. php? Data QR code? Phpheader (content-Type: texthtml; charsetutf-8); $ receivetdata (data); if (empty ($ data) {$ str parameter description brdata

According to the official phpqrcode version, download the phpqrcode official version and put api. php in it. How to Use http: // domain name/phpqrcode/api. php? Data = QR code? Phpheader ("content-Type: text/html; charset = UTF-8"); $ data = getdata ('data'); if (empty ($ data )) {$ str = "parameter description br/data

Modified according to phpqrcode official Original Version
Download the official phpqrcode version and put api. php In It.
Usage
Http: // domain name/phpqrcode/api. php? Data = QR code

 Data: The data to be transcoded.
Level: Default L Error Correction level: L, M, Q, H
Size: Default 4-point size: 1 to 10, used for mobile phone 4
Margin: Default 1 margin 1 to 10
Logo: by default, the file name with an empty intermediate logo needs to be placed in the logo/directory.
Logosize: The default value is 5. The smaller the number of logo images from 1 to 10, the larger the image size is. We recommend that you increase the level value.
Filename: by default, empty file names are generated and put in the temp/directory.
"; Echo $ str; exit;} $ level = getdata ('level', 'L'); // Error Correction level: l, M, Q, H $ size = getdata ('SIZE', '4'); // The point size: 1 to 10, $ margin = getdata ('margin ', '1'); // margin $ logo = getdata ('logo '); // logo $ filename = getdata ('filename'); // generated file name $ logosize = getdata ('logsize', '5 '); // logo $ path = 'temp/'; if (! Empty ($ filename) {$ filename = paipath.20.filename.'_'.$size.'.png ';} else {$ filename = false;} if (! Empty ($ logo) & empty ($ filename) {$ filename = path.20.logo.'_'.sisize.'.png ';} $ QR = false; if (! Empty ($ filename) {$ QR = $ path. basename ($ filename);} include "qrlib. php "; $ QRcode = new QRcode (); $ QRcode-> png ($ data, $ QR, $ level, $ size, $ margin); if ($ logo) {if (strpos ($ logo, 'HTTP: // ') === false) $ logo = 'logo /'. $ logo; $ QR = imagecreatefromstring (file_get_contents ($ QR); $ logo = imagecreatefromstring (file_get_contents ($ logo); $ QR_width = imagesx ($ QR ); $ QR_height = imagesy ($ QR); $ logo_width = imagesx ($ logo); $ log O_height = imagesy ($ logo); $ logo_qr_width = $ QR_width/$ logosize; $ scale = $ logo_width/$ logo_qr_width; $ logo_qr_height = $ logo_height/$ scale; $ from_width = ($ QR_width-$ logo_qr_width)/2; $ from_height = ($ QR_height-$ logo_qr_height)/2; imagecopyresampled ($ QR, $ logo, $ from_width, $ from_height, 0, 0, $ logo_qr_width, $ logo_qr_height, $ logo_width, $ logo_height); header ("Content-Type: image/jpg "); Imagepng ($ QR); exit;} if (! Empty ($ filename) return $ filename; function getdata ($ name, $ default = '') {$ getdata =$ _ GET; return empty ($ getdata [$ name])? $ Default: $ getdata [$ name] ;}?>

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.