I am building a verification website that utilises QR codes which once scanned show a page which says that the product is genuine.

I want to add a "claim listing" button to the bottom of the page which will show a "successfully claimed this listing" page.

Problem: After the listing has been claimed I want the same QR code to show a page which states "this listing has already been claimed".

I have racked my brain for hours now, trying to figure out the easiest method to achieve this but am constantly hitting walls, any help would be greatly appreciated!

Thanks folks, Dan


Do I understand problem correctly?

[QR1] -> Scan -> [Claim listing] -> [QR1->QR2 claimed] -> [QR2]

Here what comes to mind

class RenderPage 
  function gen_qr(is_claimed)
    if (is_claimed) return generate_qr2;
    else return generate_qr1

  function display_page()
    $qr_code = gen_qr(get_option('<page_id>_qr'));

    // on button click update_option('<page_id>_qr')

It's a bit schematic, but I think you got the idea.

P.S. Just to clarify. Method display_page() renders page withrespect to the fact if listing is claimed (whatever that mean :D), it also has button, that sets "listing claimed" tag to database. qr_gen() generates code that will contain required information based on database option for corresponding page.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.