Skip to Content
PHPCODE
Code Build QR Code Generator with PHP and Ajax
php code / September 8, 2018

Step By Step
NOTE :- library Used  phpqrcode Download http://phpqrcode.sourceforge.net/

Step 1 :- Created header.php

<!DOCTYPE html>
<html>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ />
<link rel=”stylesheet” href=”https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css”>
<link rel=”stylesheet” href=”https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css”>
<script src=”https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js”></script>
<script src=”https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js”></script>
<!– jQuery –>

Step 2 :- Created footer.php

<div class=”insert-post-ads1″ style=”margin-top:20px;”>

</div>
</div>
</body></html>

Step 3 :Created container.php

</head>
<body class=””>
<div role=”navigation” class=”navbar navbar-default navbar-static-top”>
<div class=”container”>
<div class=”navbar-header”>
<button data-target=”.navbar-collapse” data-toggle=”collapse” class=”navbar-toggle” type=”button”>
<span class=”sr-only”>Toggle navigation</span>
<span class=”icon-bar”></span>
<span class=”icon-bar”></span>
<span class=”icon-bar”></span>
</button>
<a href=”https://phpcodeinfomation.blogspot.com/p/php-script.html” class=”navbar-brand”>PHPCODE</a>
</div>
<div class=”navbar-collapse collapse”>
<ul class=”nav navbar-nav”>
<li class=”active”><a href=”https://phpcodeinfomation.blogspot.com/p/php-script.html”>Home</a></li>

</ul>

</div><!–/.nav-collapse –>
</div>
</div>

<div class=”container” style=”min-height:500px;”>
<div class=”>
</div>

Step 4 :- Created index.php

<?php
include(‘header.php’);
?>
<title>phpcode : Code Build QR Code Generator with PHP and Ajax</title>
<link rel=”stylesheet” href=”css/style.css”>
<script src=”script/ajax_generate_code.js”></script>
<?php include(‘container.php’);?>
<div class=”container”>
<div class=”row”>
<h2>Example: Build QR Code Generator with PHP and Ajax</div>
<div class=”col-md-3″>
        <form class=”form-horizontal” method=”post” id=”codeForm” onsubmit=”return false”>
            <div class=”form-group”>
            <label class=”control-label”>Code Content : </label>
            <input class=”form-control col-xs-1″ id=”content” type=”text” required=”required”>
            </div>
            <div class=”form-group”>
            <label class=”control-label”>Code Level (ECC) : </label>
            <select class=”form-control col-xs-10″ id=”ecc”>
            <option value=”H”>H – best</option>
            <option value=”M”>M</option>
            <option value=”Q”>Q</option>
            <option value=”L”>L – smallest</option>       
            </select>
            </div>
            <div class=”form-group”>
            <label class=”control-label”>Size : </label>
            <input type=”number” min=”1″ max=”10″ step=”1″ class=”form-control col-xs-10″ id=”size” value=”5″>
            </div>
            <div class=”form-group”>
            <label class=”control-label”></label>
            <input type=”submit” name=”submit” id=”submit” class=”btn btn-success” value=”Generate QR Code”>
            </div>
        </form>
    </div>
    <div class=”col-md-6″>
    <div class=”showQRCode”></div>
    </div>
</div>
</div>
</div>
<?php include(‘footer.php’);?>

Step 5 :- Created generate_code.php

<?php
if(isset($_POST) && !empty($_POST)) {
include(‘library/phpqrcode/qrlib.php’);
$codesDir = “codes/”;
$codeFile = date(‘d-m-Y-h-i-s’).’.png’;
$formData = $_POST[‘formData’];
// generating QR code
QRcode::png($formData, $codesDir.$codeFile, $_POST[‘ecc’], $_POST[‘size’]);
// display generated QR code
echo ‘<img class=”img-thumbnail” src=”‘.$codesDir.$codeFile.'” />’;
} else {
header(‘location:./’);
}
?>

Comments

Best view i have ever seen !

yppyezrgyh says:

Code Build QR Code Generator with PHP and Ajax – PHPCODE
[url=http://www.gx0edel03v67m26ni88p5dyd944517nis.org/]uyppyezrgyh[/url]
ayppyezrgyh
yppyezrgyh http://www.gx0edel03v67m26ni88p5dyd944517nis.org/

Leave a Reply

Your email address will not be published.

PHPCODE © 2023