Jump to content

Going about a random user system in PHP


g1c9

Recommended Posts

Ok, I need your feedback on how to go about this. (Kind of like a puzzle, but this is for something practical.)

This is basically what I want.

Lets say I have 5 pages, and they all have a variable. See below.

page | variable value
------------------------
1 | APPLE
2 | COOKIE
3 | BANANA
4 | MONKEY
5 | TREE

Now on each of my 5 pages, I want to display a word from one of the 4 other pages. Each page's word needs to be displayed as many times as that page has displayed all the other page's word. Each page displays a word when it loads. So basically, these words have a 1:1 display rate. (Everytime one word's page displays another page's word, another page will display its word.)

The idea i have thus far is this:

make a plain text file and put assign a key ID to each one of the items i listed above. On each page's load the file will be opened and the key will be read from the file, matched up in a DB with it's noun from the list, and then displayed. Then the noun from the page that just did all that will open up the text file and write its noun's key to the file. Wash, rinse, and repeat.

However, I think that will get very,very slow becuase I plan on having many,many words. How do you suggest I go about this?
Link to comment
Share on other sites

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.