/ Published in: PHP

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php /* * by Alex Dahlem * http://twitter.com/alexdahlem * * Dynamically creates a nice picture with a QR-Code on it * * Use this png as background: http://twitpic.com/5ds1iz * Copy the background.png in the same folder as your script * * You can use this code in any project you want. Mention me if you like it :) * * Love to qrserver.com for their API! Take a look at their services! * *** Death to false markup! *** Cheers! */ // Tell the browser this script is an image // Our imagecontainer // We want to use transparency, so let's tell the image // Now we fill the imagecontainer with a transparent color // Our background graphic // Copy the background into the container // Our QR-Code $qrimage = imagecreatefrompng('http://api.qrserver.com/v1/create-qr-code/?size=265x265&data=http://twitter.com/alexdahlem&bgcolor=808080'); // We need a photoshop-style layer effect for ($i = 0; $i < 3; $i++) { // Copy the QR image three time for besser contrast } // Finally render the container ?>
Comments
