Ihsaan Posted May 16, 2013 Share Posted May 16, 2013 I intend printing 10 business cards each one having a QR code that link to a webpabe. The QR code will point to www.test.com/qr?12345 where 12345 is the unique number with each business card. On the webpage there will be an input box and that input box should automatically have the unique number it it. Im trying to wrap my mind around how this will work and how to code it... Any suggestions welcome Quote Link to comment https://forums.phpfreaks.com/topic/278058-qr-code-with-unique-numbering/ Share on other sites More sharing options...
QuickOldCar Posted May 16, 2013 Share Posted May 16, 2013 I think the best thing to do would be to use mysqls built in autoincrement for id's but if you wanted to, you can assign them qr codes by using an md5 of uniqid() $qr_code = md5(uniqid(rand(), true)); Save that $qr_code value into that users account so it links their info to that code Quote Link to comment https://forums.phpfreaks.com/topic/278058-qr-code-with-unique-numbering/#findComment-1430387 Share on other sites More sharing options...
Ihsaan Posted May 16, 2013 Author Share Posted May 16, 2013 Thanks QuickOldCar but im more interested to know how to get the code from the url into the input box Quote Link to comment https://forums.phpfreaks.com/topic/278058-qr-code-with-unique-numbering/#findComment-1430424 Share on other sites More sharing options...
Jessica Posted May 16, 2013 Share Posted May 16, 2013 (edited) <?php echo '<input type="text" name="code" value="'.$_GET['qr'].'">'; ?> Assuming you do all the proper error checking to make sure it's set first, etc. Edit: Unless the URL query string is actually just ?12345 In which case $qr = array_shift(array_keys($_GET)); Then use as above. Edited May 16, 2013 by Jessica Quote Link to comment https://forums.phpfreaks.com/topic/278058-qr-code-with-unique-numbering/#findComment-1430427 Share on other sites More sharing options...
Ihsaan Posted May 16, 2013 Author Share Posted May 16, 2013 Thanks Jessica, will try it out and let you know Quote Link to comment https://forums.phpfreaks.com/topic/278058-qr-code-with-unique-numbering/#findComment-1430430 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.