Welcome to healthcare magic.
Thank you for your query.
It may be internal hemorrhoids
or anal fissure
Both of them are painful & causes bleeding.
If there is long history of such a problem then some disease need to be considered.
Crohn's disease , TB or malignancy should be excluded.
Consult with a general surgeon
Proctoscopy may be needed for better evaluation.
I hope I have been some help of your query.
Please write if you have any doubt.