What can cause terrible foot swelling with pain in both feet and a fever?

Swelling pain. First if you are having swelling of both legs with fever i highly recommended you either see your doctor or go to nearest er. It could either be cellulitis or a dvt, which is a blood clot in your leg.
Need to determine . If the two are even related. If the foot sweling is new onset or the fever does to go away, see a doctor.
Couple of things. Fever is usually caused by infection. I would be concerned about cellulitis and possible blood clot and would seek attention immediately.