1

I have used Google chart and the LGPL QR code class for php to generate the QR code for an URL, but both fail to generate a correct for the URL below:

http://www.xxxxx.com/xxxx/index.php?route=sale/order/invoice&order_id=4&token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

The result of the QR code after scanning will be something like

http://www.xxxxx.com/xxxx/index.php?route=sale/order/invoice&order_id=4&token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Is there any way to avoid the amp; to appear?

Grice
  • 1,345
  • 11
  • 24
  • 1
    I don't quite understand the problem; both URLs in the question seem to be exactly the same? – Codor Nov 21 '14 at 13:46
  • @Codor It's formatted wrong. Look at the markdown and you'll see that one is `&token` and the other is `&token` – Grice Nov 21 '14 at 13:50
  • How are you scanning the QR code? If from smartphone, what is the name of the app? Also, can you link us the QR-code (with fake data but same URL construction)? – ihsan Nov 27 '14 at 16:02
  • I think you're using Opencart's url helper to generate the URL? If so, read through my answer to this (seemingly unrelated) question http://stackoverflow.com/a/27262139/1301076 I suspect you have exactly the same problem – rjdown Dec 05 '14 at 00:56
  • `&` is a HTML-Code for `&` - consider this: https://stackoverflow.com/questions/3541711/url-encode-sees-ampersand-as-amp-html-entity You can also look into my answer about QR-generation in python: https://stackoverflow.com/a/68385427/4575793 – Cadoiz Jul 14 '21 at 21:46

1 Answers1

0

I am not sure, wheter it helps you. Reason is that I have some difficulties to understand your question.
Maybe this javascript helps you generating you URL, I am using it as bookmark.

javascript:void(window.open('http://chart.apis.google.com/chart?cht=qr&chs=300x300&chl='+encodeURIComponent(location.href),'Qr code','top=100,left=200,width=350,height=350,status=yes'));
David Ansermot
  • 6,052
  • 8
  • 47
  • 82
Paulquappe
  • 144
  • 2
  • 6
  • 15