QR Code Generator in PHP and Javascript

QR Code Generator JavaScript Library: This is a JavaScript library that can

<!DOCTYPE html>
    <meta charset="UTF-8">
    <title>QR Code Generator</title>
    <script src="https://cdn.rawgit.com/davidshimjs/qrcodejs/gh-pages/qrcode.min.js"></script>
    <h1>QR Code Generator</h1>
        <label for="business-name">Business Name:</label>
        <input type="text" id="business-name">
        <label for="name">Name:</label>
        <input type="text" id="name">
        <label for="phone">Phone:</label>
        <input type="text" id="phone">
        <label for="website">Website:</label>
        <input type="text" id="website">
        <button onclick="generateQRCode()">Generate QR Code</button>
    <div id="qrcode"></div>

        function generateQRCode() {
            // Get the user input
            var businessName = document.getElementById('business-name').value;
            var name = document.getElementById('name').value;
            var phone = document.getElementById('phone').value;
            var website = document.getElementById('website').value;

            // Concatenate the data
            var data = 'Business Name: ' + businessName + ', Name: ' + name + ', Phone: ' + phone + ', Website: ' + website;

            // Generate the QR code
            var qrcode = new QRCode(document.getElementById('qrcode'), {
                text: data,
                width: 256,
                height: 256,
                colorDark : '#000000',
                colorLight : '#ffffff',
                correctLevel : QRCode.CorrectLevel.H

This code generates a form with input fields for the user to enter the required data. When the "Generate QR Code" button is clicked, the library generates a QR code image and displays it on the page.

Related Articles

- All From ChatGPT