Jump to content

Archived

This topic is now archived and is closed to further replies.

g1c9

Going about a random user system in PHP

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?

Share this post


Link to post
Share on other sites

×

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.