This is a little script I put together in 2001(!) to create a DIY choose-your-own-adventure story. For a while it got popular and the story got a little crazy. You can view the original installation here:
http://www.iamcal.com/games/choose/
Some clever folks created a fork on github, including the DB connection guts and an installer script. If you actually want to use it, their version is a much better place to start.