Are you following a basic tutorial to do what you've described? If not, find one of those and follow it. I'm sure there are several.