Treatment of constipation needs diet and lifestyle changes in the child which will need extensive councelling. Apart from plenty of fluids and avoiding refined foods there are habitual changes you can bring in his schedule. Appearance of blood probably suggests injury around the anal region and should be examined by a doctor before prescription of medication.
Next Steps
need to also rule out a stool infection.
Health Tips
In case your child is predominantly milk fed please decrease quantity of milk and increase solid foods in diet.