Well, according to your description, it is very likely that you may get wrong prescription. You need to go to a local optical store to have your prescription tested again as well as your new glasses. By the way, you need to stop wearing your new glasses from now on until you find the reasons or your vision will worsen. However, besides a headache, do you have any other symptoms such as blurred vision and anything else? As you know, some people will get a headache when wearing their new glasses for the first time because they need time to adjust to them. But in a few days, things will get much better.