Turn off the water to the toilet by turning the shutoff valve clockwise as far as it will go. Flush the toilet and hold down the handle to empty the tank, then disconnect the toilet supply hose by unscrewing it from the tank with adjustable pliers. Put a bucket under the tank to catch water.
Unscrew the bolts holding the toilet to the flange with a wrench. If they are too corroded to turn, spray lubricant on them, wait five minute and try again. If you can't get one of them to turn, you may have to cut off the nut with a hacksaw. Have someone sit on the toilet while you cut to make space between the nut and the toilet.
Lift the toilet away from the flange and set it down on old newspaper spread in another part of the bathroom or outside. Clean the wax off the flange with a putty knife, collect it in some more old newspaper and throw it away. Take out the foitet bolts and discard them.
Examine the flange. If one or both of the bolt tracks are corroded, you can use repair plates to fix them. They slip under the flange and align with the bolt tracks to hold the bolts from underneath. If the corrosion is more extensive, use a repair ring, which fits over the old flange.
Unscrew the flange bolts, then slide the repair plate underneath the flange and adjust it so it's underneath the damaged section and its holes are aligned with the flange holes. Replace the flange screws and drive an extra one to secure the plate.
Place the repair ring over the old flange and adjust it so that its tracks align with the tracks on the flange. Screw it to the floor with three or four No. 10 wood screws. The holes in the ring are offset from those in the flange so you can screw the ring down without removing the flange screws.
Slide a new toilet bolt into each of the tracks on each side of the flange and arrange them so they are opposite each other and form a line parallel to the back wall.
Place a wax ring on the flange with its tapered side down. Clean the old wax off the bottom of the toilet and set the toilet in place on the flange with the bolts extending through the holes in the bottom. Sit on the toilet facing the back wall and rock to compress the wax.
Put a washer and nut on each toilet bolt and tighten the nuts alternately with a wrench. Stop tightening as soon as the toilet stops rocking. Overtightening can crack the toilet.
Screw the water supply onto the tank connection and turn on the water. Let the tank fill, then flush once or twice and check for leaks.