SoftwareQuery
Home About Contact

How To Create QRCode in PHP

 SoftwareQuery     No comments   


Step-1. Firstly Download Xampp Server then go to c drive and open Xampp server folder then open htdocs doc folder then create a new folder with QRcode.

Step-2. Download QRCode library Referer URL: https://github.com/t0k4rt/phpqrcode
               


Step-3. After Download Extract zip file then copy Qrcode folder and paste inside xampp->htdoc->Qrcode folder.

Step-4. Outside the library, folder creates new file generate.php.

Step-5. Copy this code and paste generate.php then save.
        <!doctype html>
       <html>
       <meta charset="utf-8">
       <title>softwarequery.com</title><body>
       <?php
include("qr/qrlib.php");
$nameOfImage = time().'.png';
QRcode::png("www.google.com",'QRImages/'.$nameOfImage,"H","10","10");
?>
<img src="<?php echo 'QRImages/'.$nameOfImage;?>" title="Image "/>
        </body>
        </html>

Step-6. Go to the browser then open new tab then type localhost/foldername/generate.php.
                   


Step-7. If you want test Qrcode is working or not download code two Qr code desktop software.
           Refer Url: https://www.codetwo.com/freeware/qr-code-desktop-reader/

Step-8. If you want to save Direct data in Qrcode create a new folder then make index.php file then copy this code and paste the index.php file.

         <!DOCTYPE html>
          <html>
         <head>
        <title>Qr code</title>
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
        </head>
       <body>
        <textarea onkeyup="generate_qrcode(this.value)" cols="50" rows="5"></textarea>
        <div id="result"></div>
      </body>
        <script>
       function generate_qrcode(sample){
       $.ajax({
       type: 'post',
       url: 'generator.php',
       data : {sample:sample},
       success: function(code){
       $('#result').html(code);
        }
       });
        }
      </script>
      </html>

Step-9. Create another Qr.php file then copy this code and paste Qr.php file.
          <?php
         $code = '<center><img src="https://chart.googleapis.com/chart?chs=300x300&cht=qr&chl='.$_REQUEST['sample'].'" title="Link to Google.com"></center>';
        echo $code;
         ?>

  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg
Email ThisBlogThis!Share to TwitterShare to Facebook
Newer Post Older Post Home

0 comments:

Post a comment

Donate

Translate

Popular Posts

  • How to Make Image Upload Code Using AJAX
    Direct Copy Paste PHP File  Image Upload Code -   <html> <head> <meta charset="utf-8"> <meta http-equi...
  • Best Useful Free Plugin to Make Wordpress Theme
    Meta Slider   - Meta Slider is that the initial free possibility on today’s list. A premium version is additionally obtainable...
  • How To Install Magento on Localhost XAMPP OR WAMP SERVER
      Step-1 => Make Sure you have to install Latest Version of  Xampp server or Wamp server in your PC.   Step -2 => Go to Web Bro...
  • How To Intall Node.js Via Command On Window And Linux.
    Step-1 . Firstly We have to go official website of https://nodejs.org/en/ then download the latest version of Nodejs zi...
  • How to Set up Amazon Affiliate Marketing Account to Earn Money
    Amazon Associates is a  marketing of Amazon company. It is allowed to youtube channel owner, Social Media pages owner and any type...
  • How To Create Custom Pagination In WordPress
    Hello, Friend's in this post we are creating a custom code of Pagination in WordPress. It is very easy to put this code any custom...
  • How to create facebook share and like button for webpage
    Step-1 . Go to web browser type google and write facebook sharing button click this URL or open this URL.                     Ref URL:...
  • How To Scrape Data From Website Url Using Php.
    Q. why using a Scraping. If we want to get data of another website then using web scraping. It is using a PHP HTML Dom parser library ...
  • How To Install Wordpress in Xampp Server And Wamp Server
      Step 1st  -      Install WampServer or Xampp Server.                                                                               ...
  • Upload Multiple Images to Firebase Storage with Angular
    Step-1 . Create a new Angular Project open command window then write a command.                     #ng new UploadImageApp Step-2 ....

Home

This blog Is very help full for beginner coder,if you want to learn new things definitely this Blog is very
helpful for you guys.

Followers

Contact form

Name

Email *

Message *

Blog

  • Home
  • About Us
  • Privacy Policy
  • Disclaimer
  • Contact Us
  • Terms&Conditions

NewsLetter

Copyright © SoftwareQuery | Powered by softwarequery
Design by ShubhamTiwari | Theme by softwarequery.com | Distributed By softwarequery/