Page 1 of 1

$var rotation

Posted: Thu Apr 01, 2004 12:20 pm
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

Posted: Thu Apr 01, 2004 12:34 pm
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

Posted: Thu Apr 01, 2004 12:39 pm
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:

Posted: Thu Apr 01, 2004 1:46 pm
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