How to get my songs from my iPhone to my computer?

I've recently purchased a new laptop and installed iTunes, but all my music was on my last computer before it broke. I can get back all the music I purchased but is there any way for me to get music that I acquired from different routes (CD's, friend's USB) off of my phone and into my new computer?

If the music is on the iPhone and you want to transfer it back to the computer, use DiskAid
http://www.digidna.net

iTunes won't let you do that.iTunes only allows transfer from the computer to the iPhone - not the other way round. Why? Ask Apple. That's how they want it and how they designed it.

What do you mean your last computer broke?

If the hard drive is working, you can easily extract it from the old computer and connect it to the new one. If the new one has an empty bay, you can use it as an 2nd internal hard drive. If there are no empty bays, then you can use it as an external hard drive using a SATA-to-USB cable or an enclosure

  • How to transfer my songs from my phone to my computer. I have apple for both iPhone and computer? When I was little, I went on a buying spree for random songs, now I totally regret it. I want to transfer those songs from my iPhone to my computer and delete the songs on my computer. I sipe left on my phone which deletes them, but their still on my apple account and be easily re-download.
  • How to sync songs in your iPhone 5? Sync songs from the computer to iPhone 5? I downloaded itunes in my computer, and i also plug in the iphone 5 cable to the pc, but i see no iphone icon in the itunes. I don't know why there's no iphone icon in the itunes, and when i went to settings, i touch the music section, and they said that i need a itunes match.
  • How to get the songs that I want (and only those songs) on my iPhone 4S? I was originally having problems with iMessage, and decided to try restoring my iPhone 4S. After restoring, erasing all contents, and then restoring from backup, every single song in my iTunes is appearing with the iCloud symbol on my iPhone, even if they are unchecked, and even if iCloud is turned off. I have turned off iTunes Match and tried restarting both my computer and my iPhone, but nothing seems to be working. Any help would be greatly appreciated.
  • How to get songs off my iphone to my computer? I torrented a bunch of songs onto my iPhone (i know illegal blah blah). I got a new computer, and sadly i don't have the songs on the new computer. I tried to see if maybe iTunes kept them, but i was wrong. So how do i get them from my iPhone onto my computer, and then to itunes?