Jump to content


Photo

Going about a random user system in PHP


  • Please log in to reply
1 reply to this topic

#1 g1c9

g1c9
  • Members
  • PipPip
  • Member
  • 11 posts

Posted 05 February 2006 - 09:13 PM

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?

#2 play_

play_
  • Staff Alumni
  • Advanced Member
  • 717 posts

Posted 07 February 2006 - 08:37 PM

maybe an array or database?
regex.kat.sh --- regex library
u.kat.sh ---- url shortener
tabbit.org ---- tabbed pastebin




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users