Is there a way to use just my iPhone 3GS as a remote for my t.v.?
just the phone and the tv. I don't want any other attachments
No, you wouldn't be able to use just your iPhone as a remote. You would have to add something else on it because they don't have the lasers and things for it to be able to function as a remote.
The iPhone does not have infared, therefore you need to go through wifi. There is one TV that has a remote app that works, I believe it's a Phillips.
Why don't you just search the App store for TV remotes? I did, there appears to be several. Seems easier than asking here, and getting wrong answers from people.