Search and return information

Here is what I’m trying to do.

Four territories with a search box to enter a zip code.

When the zip code is entered it will search a database and come back with a territory number.

Depending on what number that is will determine what flash movie will load.

Is this possible and where might I find information on how to accomplish this?