How did edward turn into a vampire?

Back in 1915 (it might be later, but 1915 was when the epidemic started), during the Spanish flu epidemic, Edward fell victim to the Spanish flu. He was going to die, when Carlisle Cullen, who was running the clinic that Edward was in, decided to save Edward's life by biting him and turning him into a vampire. Hence why Edward is over 100 years old.