I'd take a guess and say that your XP is on an active partition on your original D drive which is set as a slave. The drive your friend gave you is set as a master and the machine is trying to boot from that and failing.
1. Take out your original drive and put it to one side.
2. Take the new drive and set the jumpers as master and install on the primary IDE cable.
3. Set the jumper for your CD drive as master and put it on the other secondary IDE cable.
4. Set your BIOS to boot from the CD drive before the HDD.
5. get your BIOS to detect the new drive. (Depending on the age, it will either have an auto-detect setting or you will have to tell it to look).
6. Insert your XP CD and let the PC boot.
7. When prompted, get XP to reformat the drive as a single partition and install XP.
8. Set the BIOS to boot from the HDD before the CD, remove the CD and reboot.
Your machine should now boot with the "new" drive as drive C and the CD as drive D.
If your get that far, you can start on the old drive that stopped working on you.
9. Set the jumper on your old drive to slave and put it on the same,secondary, IDE cable as the CD drive. Then reboot into BIOS and get the machine to detect the drive. If it does, then it can be reformatted, if it doesn't, it's dead and will need replacement. If your machine won't reboot, then the old drive is dragging it down. Bin it.
10. Reboot the machine and see if the drive is detected by Windows Explorer/My PC. If so, It will become the D drive, and the CD will move down to become the E drive. Copy all the files you want to keep off it to the new C drive. You should then use XP to reformat it to try and get rid of the problems on it. (See the link about Disk Management below).
11. If the drive is working and is detected by the BIOS, but Explorer can't see it. Go to
Disk Management and see if it is there. if so, you've lost the data but can try to reformat the drive. Then reboot and the drives should re-order as above. If Disk Management can't see it, or the format fails, I could suggest a low-level format to try and recover it, but, to be honest, you'd be better off just binning it.