If your state requires a physical food handler card, you must show proof of passing an online food handler test for an physical card at a government facility; the card itself cannot be printed at home. Approved providers of online tests vary by state.
One of the main providers of online training for food handlers, StateFoodSafety.com, covers over a dozen states, but since many states have preferred online training providers, it's important to check which providers' courses are acceptable before paying for or taking a course that may not be appropriate to your location. Once you pass the food handler exam, the provider sends you confirmation of your success, usually in the form of a completion certificate. However, this is not the same thing as an official food handler card, and not all states accept this in lieu of a physical card.
Most states and counties have time limits for taking your proof of qualification to an appropriate site to exchange for your food handler card. For example, you must present your Certificate of Training to the Kansas City Health Department within 30 days to receive your food handler card. Again, these limits vary by area, so check your own jurisdiction for details.