Generate QR code in codeigniter

What is QR code

QR code (abbreviated from Quick Response Code) is the trademark for a type of matrix barcode (or two-dimensional barcode) first designed for the automotive industry in Japan. A barcode is a machine-readable optical label that contains information about the item to which it is attached. A QR code uses four standardized encoding modes (numeric, alphanumeric, byte/binary, and kanji) to efficiently store data, extensions may also be used.

In this tutorial we will show you how to generate QR code in Codeigniter framework using qrcode library. This tutorial also contains Demo in which you can see how the code generating and can check output through scanning the code via various QR code scanner available in the market.

Code Sample

Download the code from below or See the Demo

You can download full source code here, also you can check our demo here.

Download Now DEMO

That’s it. Download the full source code with library and implement it on your web app. You can also use this library in Core Php after making some required changes.

  • yhy

    Thanks, will keep this for my future project.

    • Tangle Skills

      Glad you like it.

  • Help me Senpai

    Hi, can someone help me on this

    Message: imagepng(C:xampphtdocsMyMeritSystemuploads/qr_image/17135.png): failed to open stream: No such file or directory

    Filename: qrcode/qrimage.php

    • Tangle Skills

      What exact problem you are having ? Check our demo section to see how it works.

    • Tangle Skills

      Message: imagepng(C:xampphtdocsMyMeritSystemuploads/qr_image/17135.png): failed to open stream: No such file or directory

      Location should be like this

      Message: imagepng(C:xampp/htdocs/MyMerit/System/uploads/qr_image/17135.png):
      Correct it and will work fine

  • thank u so much

    • Tangle Skills

      you’re welcome.

  • midlaj muhammed

    wawooo working nicely..
    thank you somuch

    • Tangle Skills

      you’re welcome.

  • Shabbirhasan Nandoliya

    Getting this error

    An Error Was Encountered

    Non-existent class: CI_Ciqrcode

    help me……!

    • Tangle Skills

      Class name is Ciqrcode not CI_Ciqrcode.

      Just load the library using this
      $this->load->library(‘ciqrcode’);

      or if you are not using Codeigniter just load class name “Ciqrcode”.

      • Shabbirhasan Nandoliya

        class name “Ciqrcode”alredy define but getting error in “Non-existent class: CI_Ciqrcode”

  • nicko360

    Thank you. Really useful example. I used this combining with domPDF in CodeIgniter 3, to put the QR there.

  • Sunil Patel

    hi
    i want to generate a QR Code for a PHP form,
    i.e on scannning of the code it should directly open the form for input

    • Tangle Skills

      Use the form link to generate QR code and after the scan, the link will show and after clicking on its page will open with form. That’s the only possible way I can see.