In the Reimer-Tiemann reaction, phenol reacts with chloroform (CHCl$_3$) and aqueous sodium hydroxide (NaOH) to form salicylaldehyde via the following mechanism:
Phenol undergoes ortho-substitution due to the electrophilic attack of dichlorocarbene (:CCl$_2$), generated in situ from CHCl$_3$ and NaOH.
The intermediate formed is the sodium salt of dichlorophenol.
On further hydrolysis and protonation, salicylaldehyde is obtained.
The reaction proceeds as: