Singleton
You should look at the Singleton and Registry Design Patterns. Your solution is as old as the hills, but ultimately a bad idea. Look up Dependency Injection, instead.
Jordan
You could use sessions as Surry stated, or the $GLOBALS but they are both frowned upon.
I suggest using a Singleton coupled with magic setters and getters. The setters can set any data in an array. Grabbing the instance from the singleton and calling the magic get function will fetch that data.
I created an example on ASCIIBin here: http://www.asciibin.com/HHR
Jordan
No problem! The idea isn't actually mine. I read about it in either PHP Objects, Patterns, and Practice or Pro PHP - Patterns, Frameworks, Testing and More. Both excellent books.
Corey Ward
The Zend Framework's "Zend_Registry" does as noted above regarding using a singleton and arrays with magic methods if you're interested in just having something work now without creating your own from scratch.
PS: your captchas are case sensitive if you didn't know.
Corey
I updated the sample script Jordan posted to work more like Zend_Registry where you don't need to instantiate anything to access the data. You can instead use static regular methods.
http://www.asciibin.com/EQB
Surry
5:23 AM - July 1, 2009Why don't you store them in sessions?