Take 1/2 cup powdered detergent, 1 teaspoon ammonia and a quart of hot water. Mix these in a bowl really well. Pour the liquid into a foaming spray bottle. Spray onto carpet, enough to slightly moisten, and rub in with a sponge. Allow carpet to dry then vacuum. You can do this for a small spot or the entire carpet.
This solution worked great for me last night. Let me know how it works for you.