Connecting landline to soundcard
If the goal of this action to record the call or to use computer headset for telephoning, it is more safe solution to buy a voice modem. Costs 10-20 USD and there are plenty of software to record sound,  make answering machine, etc.

It is right that you cannot connect the phone line directly to your sound card. There is around 80-100 V AC in the phone line when it is ringing! And for legal reasons you cannot connect any device to the line which is not approved by local agencies.

However, you can use an audio transformer to isolate the sound component from the dc voltage, but you have to make some protection circuit in case of ringing.