The present invention relates to a system and method for dispensing medication through a time controlled device linked to a web platform. The system includes a dispensing device in wireless communication with a computing device. A web platform on the computing device can be used to program the dispensing device with parameters such as the dosage number, minimum time period between dosages, and the like. Based on the programmed parameters, a solenoid in the dispensing device will lock or unlock based on dosages administered and the time between dosages.