Bladephp: Now with 8+ codeigniter, php, and laravel project 8+ php project From $37/Month From Rs. 2499/Month

How to Generate QR Code Using PHP And HTML

by
Category:php
php html
How to Generate QR Code Using PHP And HTML

QR (Quick Response) code used to read your data in your smart devices for ease. If you have a visiting card and want to add name, email and mobile number in you mobile its hart to type if there is a QR code of contact added on that card then you can easily add that in you contact list by scanning that code. Today i am going to show you how to generate a QR code in PHP. You may also like How to Generate Barcode Using PHP and How to generate short url using PHP and Google API.

PHP QR Code Library

HTML Code

<html>
    <body>
        <div id="wrapper">
            <form method="post" action="">
               <input type="text" name="qr_text">
               <input type="submit" name="generate_text" value="Generate">
            </form>
        </div>
    </body>
</html>

PHP Code

<?php 
if(isset($_POST['generate_text']))
{
    include('phpqrcode/qrlib.php'); 
    $text=$_POST['qr_text'];
    $folder="images/";
    $file_name="qr.png";
    $file_name=$folder.$file_name;
    QRcode::png($text,$file_name);
    echo "<img src='images/qr.png'>";
}
?>

0 Comments


Html code work in comment box


Related Post