Use a knife between the wall and the carpeting near the damp area. Work the knife so the carpeting lifts up. If you have hardwood floors, get an expert to help you remove the floorboards so as not to damage the boards themselves.
Wipe up all visible mold and mildew using a solution of 1/4 cup of white vinegar to every cup of water. The acidity will kill all mold and mildew as well as disinfect the area.
Prop up the carpet with a piece of wood or other suitable material and allow the floor to dry completely before putting the carpet back down. If dealing with floorboards, keep them in a separate area until the floor is completely clean and dry.