Jump to content

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. Edited by Jessica
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.