What was your hemoglobin level when you started the iron pills. Cerebral hypoxia
due low oxygen penetration into the brain as a result of anemia. You could be having the headache not as a result of anemia but as a result of another illness. Antimigraine medication will be of use here ( acetaminophen, ibuprofen etc) to alleviate the headache.
For the anemia, the treatment/cure will depend on the cause of it i.e iron deficiency
, vitamin b deficiency
, folic acid deficiency
, hemorrhage/bleeding, renal failure, septicemia, cardiac diseases, HIV infection, liver diseases etc. Your doctor needs to identify the cause of the anemia and treat/cure, then you will stop shorting blood (anemic) and with the associated supplementation of iron pills or blood transfusion
depending on the degree of anemia, you will recover fast enough.
So I will suggest you head to your doctor right away for a complete blood work to identify infection, liver and kidney functions/infection, malaria etc. If there is a notion of trauma or hemorrhage the doctor will do tests depending on your carefully taken medical history.
Hope this helps