There are two major types of online pharmacies:
Prescription required online pharmacies. These are licensed to comply with regulations like any other pharmacy. Each user first opens an account and sends in the details of his credit card and medical insurance. The patient or his doctor sends in a valid prescription by conventional mail. The pharmacy then sends the drugs.
No Prescription, No Doctor visit required online pharmacies. Prescriptions by online questionnaires. Most of these sites state that the questionnaires are reviewed and approved by a doctor who decides on whether or not the medicine is appropriate and whether the order should go through or not.