Random item numbers

This is more FYI, it shouldn’t change the way you stock or anything.

Morwenna was noticing that one of her customers seemed to be getting
inside info on her surprise stocking items. I thought about it, and I
*think* I know how this customer was figuring out what items were
being offered when. If you look at the link of an item when you’ve
clicked on its title (the page with the e-mail box and the “Buy Now”
button), the path is something like:
http://hyenacart.com/Test_account/prod_details.php?id=3

That number at the end (in this case, 3), used to be generated
numerically. So if you just stocked item 12, your next item would be
13. If you were previewing your items, everyone would have access to
the links and there’s no problem. But if you were stocking a surprise
item and e-mailed your group about it, a very persistent customer
might start trying the link and replacing the number with the next few
digits above your last stocked item, and get a sneak preview before
you intended it.

So I just re-coded it so that the id number is now a randomly
generated 5 digit number. That should prevent any customers from
trying to guess at id numbers to get unintended previews.

I just tested it and it seems to work fine. Please let me know if
anyone runs into any problems.

Leave a Reply

Your email address will not be published. Required fields are marked *