For the record I think frames have their uses, they're just very specific circumstances.
In your case you want to look into
SSI (server side includes). It will let you put common code in one file and share it with multiple other pages.
See this post
Server Side Scripting