Skip to content

Instantly share code, notes, and snippets.

@mhayes
Created December 16, 2010 18:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mhayes/743773 to your computer and use it in GitHub Desktop.
Save mhayes/743773 to your computer and use it in GitHub Desktop.
Creates image tag that contains QR Code
component output="no" name="qr" {
function encode(required string message) {
var url = "http://chart.apis.google.com/chart";
url &= "?cht=qr&chs=200x200";
url &= "&chl=#message#";
return image_tag(url,200,200,message);
}
function image_tag(url,w,h,alt) {
return '<img src="#url#" width="#w#" height="#h#" alt="#alt#" />';
}
}
<h1>QR Code Demo</h1>
<cfset qr = new qr() />
<cfoutput>
#qr.encode("http://cdpr.ca.gov")#
</cfoutput>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment