Getting music from my iPhone to iTunes?

So my computer was just recently cleaned and all my music is off of my computer. I really want to burn a CD for my car but I can't.So, I was wondering if there was an easy way to get all my music onto my computer for this task. The new iTunes recognizes what I have on my phone, and I can listen to it on my computer… But that's about it! It won't let me import them or move them to the iTunes library on my computer!
Any help is greatly appreciated!

It should say when you connect it. Enable Home Sharing, I don't know what version your iTunes is, so I suggest google that part so you can find out. If all else fails, you can still re download the music you bought for free.

Use your itunes to try to sync