Cardiovascular diseases (CVD) also known as heart disease are now the leading cause of death in the world. This paper presents research for the design and creation of a fuzzy logic-based expert system for the prognosis and diagnosis of heart disease that is precise, economical, and effective. This system entails a fuzzification module, knowledge base, inference engine, and defuzzification module where seven attributes such as chest pain type, HbA1c (Haemoglobin A1c), HDL (high-density lipoprotein), LDL (low-density lipoprotein), heart rate, age, and blood pressure are considered as input to the system. With the aid of the available literature and extensive consultation with medical experts in this field, an enriched knowledge database has been created with a sufficient number of IF-THEN rules for the diagnosis of heart disease. The inference engine then activates the appropriate IF-THEN rule from the knowledge base and determines the output value using the appropriate defuzzification technique after the fuzzification module fuzzifies each input depending on the appropriate membership function. Moreover, the fusion of web-based technology makes it suitable and cost-effective for the prognosis of heart disease for a patient and then he can take his decision for addressing the problem based on the status of his heart. On the other hand, it can also assist a medical practitioner to reach a more accurate conclusion regarding the treatment of heart disease for a patient. The Mamdani inference method has been used to evaluate the results. The system is tested with the Cleveland dataset and cross-checked with the in-field dataset. Compared with the other existing expert systems, the proposed method performs 98.08% accurately and can make accurate decisions for diagnosing heart diseases.