How to activate a iPhone (T-Mobile) on eBay?

So I want get new phone. Right now am using cheap T-Mobile prepaid cell phone I bought at Family Dollar (local store) for $40 and activate at home. Am using a pay as you go plan $30 per month. All I want to know if I can get a phone from eBay that said T-Mobile on it, not unlocked and just switch my old cheap phone sim card to the newer phone and start using it like normal. Will that work? If not, how do I activate it if I get one on eBay that say T-Mobile on it? Please help me out, will really appreciate if you do. Thank you!

Here's a link the phone I want:
http://www.ebay.com/...1137711983

If you want to use other sim card, you need to unlock your phone. You can get unlock code from any of the online vendors like TheUnlockArena.com to unlock it. You can't just switch sim cards until you have unlocked it.