I have two soundcards installed in my computer (one is on-board and other is PCI card). One is used in windows and other in linux. I hate going behind the computer every time that I reboot into another OS. So, is it safe to connect headphones amplifier (FiiO E3) with two soundcards? I'm not really sure that's a good idea, but I thought I should ask :)
You can't do this successfully unless the amplifier has two inputs, which is unlikely. See Hook two computers to one speaker? (although in your case it might work if the unused soundcard sets its output to high impedance)
You need a switch or a mixer. The easiest thing to do might be to bring the connections out to the front with extension cables so you can plug from one to another.
And two of these: http://www.amazon.com/QVS-CC400M-06-Male-Audio-Cable/dp/B0000932A9
Connect the male-to-male cords to the sound cards and run them up to your desk. Plug them into the two female ports on the two-to-one connector, then connect the female-to-female coupler to the male end of the connector.
It's not kosher, by any means, but it should work.
If you're worried about potential damage by connecting the two outputs to each other in a switchless configuration, there are two-channel audio switches available: http://electronicsusa.com/mk1and2.html