All four gospels have the story of jesus being anointed by a woman, but...
It took place after the entry into Jerusalem on his head
- Matt 26:6-l3, Mark l4:2-11
She anoints his feet, and just before jesus enters Jerusalem
- John 12:3
Or long before the arrival in Jerusalem during the early ministry, putting perfume(not oil) on his feet and drying them with her hair
- Luke 7:36-50