Friday, March 25, 2011

Generating QR codes

To generate a QR code on your page simply insert the following:

<img src="http://chart.apis.google.com/chart?cht=qr&chs=100x100&chl=xxxURLxxx" width="100" height="100" />

Replace xxxURLxxx with the link you want. You can also change the size, but 100 by 100 is usually large enough to accommodate most URLs.

If you want to dynamically generate the QR code, you can replace xxxURLxxx with PHP like so:

<img src="http://chart.apis.google.com/chart?cht=qr&chs=100x100&chl=<?php echo $varURL; ?>" width="100" height="100" />

No comments:

Post a Comment