• Skip to main content
  • Skip to primary sidebar

Ryan McCormick

How Do I Generate a QR Code For My Current Page in PHP?

March 27, 2011 by Ryan Leave a Comment

QUESTION
How Do I Generate a QR Code For My Current Page?

ANSWER
This is a pretty simple solution using Google’s charts API and some PHP. I uploaded a sample file which you can download by “right-click” and “save-as”: qr-code-current-page.zip

1.) You first need to determine your current page.
2.) Second, you need to implement Google’s chart api for QR codes.
3.) Write both parts into separate strings and write a final string for an image path.
4.) Echo the php in an image path.
5.) Check out your page, you should see a QR code.

Links:

1.) Google Chart API – QR Codes – More information about Google’s API.
2.) Sample PHP file showing QR code for current page. (Right-click and Save-as)

If you enjoyed this post, please comment!!

Filed Under: Web Development Tagged With: current page, dynamic generation, google charts api, QR codes

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Recent Posts

  • Force Quit Kill all Chrome Windows MacOS
  • SOLVED: Angular 6 CLI Karma Stuck in Single Run | Karma Stops Running
  • How to Manually Install Java 8 on Ubuntu 18.04 LTS
  • Remove VirtualBox from Ubuntu 16.04 Xenial
  • Clear all Node Modules Folders Recursively Mac/Linux

Recent Comments

  1. KKV on Webstorm adding spaces between imports and braces | JavaScript and TypeScript
  2. jusopi on Clear all Node Modules Folders Recursively Mac/Linux
  3. Qaisar Irfan on Clear all Node Modules Folders Recursively Mac/Linux
  4. mustafa on Remove VirtualBox from Ubuntu 16.04 Xenial
  5. Pourya on How to Manually Install Java 8 on Ubuntu 18.04 LTS

Copyright © 2025 · Magazine Pro on Genesis Framework · WordPress · Log in