Skip to content

Instantly share code, notes, and snippets.

@supercleanse
Created April 16, 2014 04:25
Show Gist options
  • Save supercleanse/10806763 to your computer and use it in GitHub Desktop.
Save supercleanse/10806763 to your computer and use it in GitHub Desktop.
<?php
$my_affiliate_url = 'http://example.com?aff=123';
$download_qr_code = false;
$pretty_link_id = prli_create_pretty_link( $my_affiliate_url );
if(!$pretty_link_id) {
header('HTTP/1.1 404 Not Found');
exit;
}
$pretty_link_url = prli_get_pretty_link_url($pretty_link_id);
header("Content-Type: image/png");
if($download_qr_code) {
header("HTTP/1.1 200 OK");
header("Content-Disposition: attachment;filename=\"qr.png\"");
header("Content-Transfer-Encoding: binary");
}
@include PRLIPRO_VENDOR_PATH."/phpqrcode/qrlib.php";
QRcode::png($pretty_link_url, false, QR_ECLEVEL_L, 20, 2);
exit;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment