Letter of recommendation from online classes
Assuming these are proper online courses, with proper work you turn in or at least exams, you should just email a couple of professors a month or 2 before you need the letters.  Explain the situation, briefly remind them who you are, and ask for recommendations.
They will be able to say in their letters what was covered in the course and evaluate your performance, so choose professors who you think will be most familiar with your work.  

This shouldn't be that different from a letter a professor for a class you physically attended, but who you never had much personal interaction with.  Note you probably get at least one reference from your undergraduate days, at least assuming that was reasonably recent.