I don't fully understand what you're trying to do... it sounds like you want to maintain variable state across multiple page requests. If so, use sessions.
If I'm not getting your drift, please re-explain your problem.
Take care,
Nik
http://www.bigaction.org/