Help with php counter and unique id generator

2 replies
Hello fellow warriors, i had begun on a new web project last week but experienced a small problem It has to do with a click counter, and a unique id/link generator. I'm trying to design a site similar to this one, psncardgenerator . com . I cant seem to understand how to make the "Get your link here" box generate a unique link for every visitor, and i dont understand how to connect that with the click counters. Someone please help
#counter #generator #php #unique
  • Profile picture of the author lordspace
    You'll basically have to insert a record in users table and then use that ID.
    The user ID will be auto increment so it'll be unique.

    What I'd do is generate the link (ajax maybe) when that button is clicked because it is not wise to create a user account on every visit.
    Signature

    Are you using WordPress? Have you tried qSandbox yet?

    {{ DiscussionBoard.errors[3796548].message }}
  • Profile picture of the author bbqhotgamesb
    You could also use a UUID, see

    en.wikipedia.org/wiki/Universally_unique_identifier

    There's generally an implementation library available in most popular languages.

    This could be helpful if you ever decide to change databases, or datastores. Especially if you're going from an RDBMS to some noSQL.

    HTH,
    B
    {{ DiscussionBoard.errors[3809395].message }}

Trending Topics