Decide what field you wish to obtain your degree in. Generally, in order to obtain a PhD you must already have a Bachelor degree and a Master degree in the subject you wish to obtain your PhD. While this is not always the case in multi- or inter- disciplinary fields--where you are occasionally allowed to enter a Master's program with a Bachelor degree in a related, but not identical field--this is usually the case in fields that are subject specific, such as English, or Engineering.
Choose a PhD program that matches your educational background and experience. While admission requirements will differ school by school, each field generally has "rule of thumb" admission expectations. Identify a field in which you qualify and begin looking for online programs in that field. You can start by searching your favorite university's online education catalog or by doing a quick Google search. You will find that most fields do not offer PhDs entirely online. The PhD is regarded in most disciplines as the highest level of formal education obtainable; hence, most traditional institutions do not offer this degree online. This does not mean you will not be able to obtain a PhD online, but you may have to adjust your area of concentration a bit, or change your major.
Find out what the preferred accrediting agency is in that field / discipline you have chosen. You can do this by visiting the professional organizations of your field's websites and looking at their education policies. If you cannot find this information online (you certainly should be able to), you can call them and ask. You can also do this by visiting the website of a school that excels in the field you are interested in. Explore the department link of the program that offers the PhD you want. Most esteemed schools will have information on their accreditors mentioned in a variety of places on the website. This is a selling point for that degree program. If you cannot easily discern who accredits them, call admissions or make an appointment to speak to an admissions representative.
Look for PhD programs that interest you online. Once you have determined the type of program you are interested in and you know the preferred accrediting commission, you are ready to find a program online that meets this criteria. Search your favorite universities to see if they offer the program online first. If you can not find an online program offered at a traditional university try searching online / non-traditional colleges and institutions.
Determine what commission accredits the school you wish to attend, once you have found a program. You will notice early on that many online and non-traditional schools are accredited to teach in specific disciplines, but they do not hold the preferred accreditation you are searching for. If the preferred accrediting commission of the discipline you have chosen does not accredit a school, this means that the preferred accrediting commission has decided that the education you will receive at that school does not meet their standards. You may still be granted a PhD from the school, but the commission will not back it. Many employers require that degrees, advanced degrees in particular, be backed by the appropriate accrediting commissions. If your degree is not, it is invalid. It is not advised to attend a school that offers a PhD but is not accredited by the preferred accrediting commission regardless of your discipline. This is especially true if you are hoping to find work that is licensed by a state board or is in education.