Greetings, sorry about the pain.
Next Steps
Get to see a physiotherapist specialised in posture correction as you have lost flexibility at hips. Not to be worried, just as a short term solution do hamstring stretch. ice the area around back thigh twice a day until you see a physio.
Health Tips
your problem is absolutely curable just that you need to follow the above instructions. if any questions do let me know.