Jump to content

QR code with unique numbering


Ihsaan

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/278058-qr-code-with-unique-numbering/
Share on other sites

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

<?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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.