How to get music from my iPhone to my iTunes onto my computer?

I purchased an iPhone 5 in October and a few months ago decided to put music on it via iTunes. Now, I don't have the money to constantly buy albums from the iTunes store so instead I used torrents to download them, which got me to about 30 albums on my phone. A few weeks ago I had to factory restore my computer which meant I lost all my music on iTunes which I thought would be easily retrievable as I have the music on my phone, I was wrong. When I tried to put more music on my phone it tells me I'll lose the songs which aren't on the computer so I tried to put them on the computer and it gives me some other email address (probably the owner of the torrent) which I don't know the password too. What I want to know is how can I get the music from my phone onto my computer and get it back into iTunes?

When your iPhone doesn't connect with the iTunes on your computer there could be multiple reasons behind it. Here are a few reasons why your iPhone wouldn't sync with the iTunes on your computer.

http://techsupport.iyogi.com/iphone-solutions/itunes-does-not-sync-with-iphone.html

The regular iPhone comes with a charger that lets you take off the 'head' of the charger to get a USB-to-iPhone cable. Put the iPhone's side into the iPhone and the USB side into your computer. From there it's easy, your phones music files, video files, photos and more will be uploaded and 'stored' on your computer.
Search 'how to put iPhone music onto iTunes' into google, there's some good apple forums and stuff there.

  • How to save DVD files onto my computer than transfer them onto iTunes? I recently bought Green Day's "Bullet in a Bible" and "Awesome As ***" as well as All Time Low's "Straight to DVD." Since I have the physical copies, I would like to save the DVD files onto my computer so that I could transfer them onto iTunes and eventually sync them onto my iPhone. I just can't figure it out.
  • How to put music from my computer onto Itunes then onto my iphone? So i have music that i've got off of the internet and i wish to put it onto my IPhone using ITunes. How do i do this?
  • How to put all my music from my iphone onto itunes On my windows computer? I just downloaded itunes… I had it before but accidentally unplugged my phone before it finished uploading the music from my phone to my computer. I just re downloaded it and half of my music is still on there, I'm scared to hit the sync button because I don't want it to erase all the music I paid for from my phone… how can I upload All of my music from my iphone to my itunes on my pc?
  • How to i get music off my new computer onto my iPhone 4s? Okay so i had a new computer that my iphone was regestered on but then when we moved we lost a cord to it so that computer no longer works, so i got my old laptop out and reset it and my sister put some music on this itunes and i want it on my phone, so how do i get music off a different computer?