Create a QRCode using Google QRCode API using PHP

1.Create a file named index.php
2.Add this code into file and access it.

Creating QR Code

QR Code will be generated as an image and it will look something like this:

<img src='<a href="https://chart.googleapis.com/chart?chs=300x300&cht=qr&chl=" rel="nofollow">
https://chart.googleapis.com/chart?chs=300x300&cht=qr&chl=</a>$code&choe=UTF-8'>

Screenshot

Creating Script

<form method="POST">
    <div>
        <label for="">Text to Convert to QRCode</label>
        <input type="text" name="text_code">
    </div>
    <button type="submit" name="generate">Generate QRCode</button>
</form>

<div>
    <?php
        if(isset($_POST['generate'])){
        $code = $_POST['text_code'];
        echo "<img src='https://chart.googleapis.com/chart?chs=300x300&cht=qr&chl=$code&choe=UTF-8'>";
        }
    ?>
</div>

Built With

Share this project:

Updates