Forums

[Shortcode] Random numbers and comments (2 posts)

  1. dodofren
    Member
    Posted 4 months ago #

    First of first, hi to you all!

    Now moving on to business...
    I'm doing a private play-by-post rpg campaign for my gaming group. I've decided to use a homebrew system that requires a use of but one dice (d10) for the system to work.

    I've been planning to use shortcodes for the dice but the problem is right here. I know how to create shortcodes and how to allow it in the comments and also how to generate a random number in php in many ways. But the problem is that just by having some random number pop up, the system also has to remember that number so it doesn't generate it on the fly on each page refresh. How would one store the number in the database or in a flat file so on a page refresh that randomly generated number actually stays the same?

    Thanks in advanced for any help, hints, links, code snippets you might post!

  2. dodofren
    Member
    Posted 3 months ago #

    To clarify on the solution I have been thinking of.
    Basically I need a shortcode that will generate a random number on comment post but not on page refresh. What would be the most sensible method to approach this problem?

Reply

You must log in to post.

About this Topic