PHP driven QR code generator
<p>This QR code generator only lets you generate for one content field. I want to add a way to generate all the info that you can generate here using php: <a href="http://zxing.appspot.com/generator/" rel="nofollow">http://zxing.appspot.com/generator/</a></p>

<p>I want the user to be able to encode MECARD and vCard</p>

<p>This is what I have so far:</p>

<pre><code>&lt;div id="generator"&gt;
    &lt;form target="qrcode-frame" action="gen.php" method="post"&gt;
      &lt;fieldset&gt;
        &lt;legend&gt;Size:&lt;/legend&gt;
         &lt;input type="radio" name="size" value="150x150" checked&gt;150x150&lt;br&gt;
         &lt;input type="radio" name="size" value="200x200"&gt;200x200&lt;br&gt;
         &lt;input type="radio" name="size" value="250x250"&gt;250x250&lt;br&gt;
         &lt;input type="radio" name="size" value="300x300"&gt;300x300&lt;br&gt;
      &lt;/fieldset&gt;
      &lt;fieldset&gt;
        &lt;legend&gt;Encoding:&lt;/legend&gt;
        &lt;input type="radio" name="encoding" value="UTF-8" checked&gt;UTF-8&lt;br&gt;
        &lt;input type="radio" name="encoding" value="Shift_JIS"&gt;Shift_JIS&lt;br&gt;
        &lt;input type="radio" name="encoding" value="ISO-8859-1"&gt;ISO-8859-1&lt;br&gt;
      &lt;/fieldset&gt;
      &lt;fieldset&gt;
        &lt;legend&gt;Content:&lt;/legend&gt;
        &lt;textarea name="content"&gt;&lt;/textarea&gt;
      &lt;/fieldset&gt;         
      &lt;fieldset&gt;
        &lt;legend&gt;Error correction:&lt;/legend&gt;
        &lt;select name="correction"&gt;
            &lt;option value="L" selected&gt;L&lt;/option&gt;
            &lt;option value="M"&gt;M&lt;/option&gt;
            &lt;option value="Q"&gt;Q&lt;/option&gt;
            &lt;option value="H"&gt;H&lt;/option&gt;
        &lt;/select&gt;
      &lt;/fieldset&gt;         
      &lt;input type="submit" value="Generate"&gt;&lt;/input&gt;
    &lt;/form&gt;
&lt;/div&gt;  
&lt;div id="result"&gt;
    &lt;iframe name="qrcode-frame" frameborder="0"  id="qrcode" src="gen.php" height="315px;" width="350px"&gt;&lt;/iframe&gt;
&lt;/div&gt;
</code></pre>

<p>and this in another file:</p>

<pre><code>    &lt;?php
if(isset($_REQUEST['content'])){
    //capture from the form
    $size          = $_REQUEST['size'];
    $content       = $_REQUEST['content'];
    $correction    = strtoupper($_REQUEST['correction']);
    $encoding      = $_REQUEST['encoding'];

    //form google chart api link
    $rootUrl = "https://chart.googleapis.com/chart?cht=qr&amp;chs=$size&amp;chl=$content&amp;choe=$encoding&amp;chld=$correction";

    //print out the image
    echo '&lt;img src="'.$rootUrl.'"&gt;';
}
?&gt;
</code></pre>

<p>This works great, but is very limited.</p>

<p>Thanks</p>
