Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generate a QR image with URL parameters

Tags:

html

url

qr-code

I'm in need of generating a QR image - but the URL needs to include parameters.

I've tried Googles:

http://chart.apis.google.com/chart?cht=qr&chs=300x300&chl=http://www.me.com/me.asp?i=1&n=2

...but the image generated, only links to:

http://chart.apis.google.com/chart?cht=qr&chs=300x300&chl=http://www.me.com/me.asp?i=1

I.e. Without n=2 at the end.

Does anyone know how to generate a QR image, which will allow more than one parameter?

like image 777
Mark Avatar asked Oct 27 '12 11:10

Mark


People also ask

Can a QR code contain a URL?

The data stored in a QR code can include website URLs, phone numbers, or up to 4,000 characters of text. QR codes can also be used to: Link directly to download an app on the Apple App Store or Google Play.


1 Answers

You have to url encode the ampersand character & , which is %26 encoded, so it gets not confused with the normal & ampersand character used to separate the variables in your google url, so use this:

http://chart.apis.google.com/chart?cht=qr&chs=300x300&chl=http://www.me.com/me.asp?i=1%26n=2
like image 164
Nelson Avatar answered Oct 20 '22 09:10

Nelson