PHP Classes

File: qrcode-form.php

Recommend this page to a friend!
  Classes of Maik Greubel   PHP QR Code Generator   qrcode-form.php   Download  
File: qrcode-form.php
Role: Example script
Content type: text/plain
Description: example script which provides a form
Class: PHP QR Code Generator
Generate QR Code images in pure PHP
Author: By
Last change: Make it more flexible for unicode characters
Date: 9 years ago
Size: 1,142 bytes


Class file image Download
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="">
<title>phpQr Demonstration</title>
<form action="qrcode-form.php">
  <label for="qrcodedata">QRCode data</label><input type="text" id="qrcodedata" name="qrcodedata"/><br/>
  <label for="width">Width</label><input type="text" id="width" name="width" value="256"/><br/>
  <label for="height">Height</label><input type="text" id="height" name="height" value="256"/><br/>
  <label for="quality">Quality</label><input type="text" id="quality" name="quality" value="50"/><br/>
  <input type="submit"/>
if(isset($_GET['qrcodedata']) && strlen($_GET['qrcodedata']))
$q = 50;
$w = 256;
$h = 256;
$_GET['quality'])) $q = intval($_GET['quality']);
$_GET['width'])) $w = intval($_GET['width']);
$_GET['height'])) $h = intval($_GET['height']);
printf('<img src="qrcode-display.php?data=%s&w=%d&h=%d&q=%d"/>', urlencode($_GET['qrcodedata']), $w, $h, $q);