Headphones and an iPhone are two totally different devices in terms of music playing. In a nutshell, the iPhone holds the music data and the headphones take the data and transmit it to sound. If you are plugging the iPhone into a headphone jack via and auxiliary cord then nothing is going to happen. If you plug it into the jack where the computer plugs into, the iPhone's music should play. By the way, do you have the iPhone 3G or original? The original has a messed up headphone jack design as many know that only allows specially designed headphones to fit in. If the cord isn't designed to work for the iPhone's weird jack design then it won't be getting in all the way to play. It obviously won't work then.
David