I have been using your code successfully for quite some time now. However I have a problem with producing the same(or similar) QR code multiple times. It seems that once I run the code once it successfully saves the QR code to a file. The second time I run the code with with same parameters (except the filename which I change by augmenting the end with '-1.jpg', '-2.jpg', etc.) it will produce the same code successfully again. However, if the same code is run three or more times it will not produce a QR code saving it to a file.
The contents of the QR code is a url which is consistent each time I run the code. I tried to change the url by passing different variables to the url each time I ran the code such as '?uid=45' but this did not resolve the problem.
The purpose of my code is to add a QR code to a coupon. In some cases a business does not mind for a client to download the same coupon multiple times. Here's where the problems occurs; when a client wants to download the same coupon a third time or more.
What change can I do/change so that the code will save the same content to a QR code sent to a file each time it is run? Here is my code:
//qrcode generator
include('qrcode/qrlib.php');
// save QR codes to server with coupon
$tempDir = "images/avatars/buscredits/coupons/";
$codeContents = "www.whosyourbrother.org/verifyoffer.php?bid=".$busid."&offer=".$adnum."&mid=3".$userid;
$fileNameWO = md5($codeContents);
$fileName = $fileNameWO.'.jpg';
$pngAbsoluteFilePath = $tempDir.$fileName;
//if file exist alter name with hypen and increasing number
/*=================================================
Filename Change Code Goes Here
I have been using your code successfully for quite some time now. However I have a problem with producing the same(or similar) QR code multiple times. It seems that once I run the code once it successfully saves the QR code to a file. The second time I run the code with with same parameters (except the filename which I change by augmenting the end with '-1.jpg', '-2.jpg', etc.) it will produce the same code successfully again. However, if the same code is run three or more times it will not produce a QR code saving it to a file.
The contents of the QR code is a url which is consistent each time I run the code. I tried to change the url by passing different variables to the url each time I ran the code such as '?uid=45' but this did not resolve the problem.
The purpose of my code is to add a QR code to a coupon. In some cases a business does not mind for a client to download the same coupon multiple times. Here's where the problems occurs; when a client wants to download the same coupon a third time or more.
What change can I do/change so that the code will save the same content to a QR code sent to a file each time it is run? Here is my code:
/*=================================================
Filename Change Code Goes Here
?>
Last edit: Clineson Redcross 2014-12-20