$var rotation

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

$var rotation

Post by malcolmboston »

sorry for the crappy explanation but basically ill explain it

i have a site built for a client but need to add some functionality to it
ok say i have this

Code: Select all

$user1 = "me";
$user2 = "you";
$user3 = "i";
now i have a problem tht i cant seem to get my head around

ok, the rotation is based on an e-mail being sent, if the email is sent to $user1 then the next time it will be $user2

im sorry for the crappy explanation as i just dont know how to explain it or let alone implement it

could anyone point me in the right direction
Mal
lostboy
Forum Contributor
Posts: 329
Joined: Mon Dec 30, 2002 8:12 pm
Location: toronto,canada

Post by lostboy »

add a table (if you have db capabilities for the site) and track the last user to get an email...once all users have completed the rotation, unset the flag in the table and start over
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Post by malcolmboston »

very interesting idea, i think this should work

does anyone else have any other ideas, ive just came across a mental block with regards to PHP whilst ive been mapping

:oops:
magicrobotmonkey
Forum Regular
Posts: 888
Joined: Sun Mar 21, 2004 1:09 pm
Location: Cambridge, MA

Post by magicrobotmonkey »

is this all in one session, or separate? put the email addys in an array and set a var to zero then use that var to pull an addy from the array and increment the value each time you send one. if this is all in one sesson, just set it to a $_SESSION var, if its not, write the int to a file
Post Reply