Here is a good article about adding pumpkin to a dog's diet to treat diarrhea:
Dr. Jean Dodds' Pet Health Resource Blog | Pumpkin: Why is it such a popular treatment for diarrhea?
But be sure that your dog sees a vet first. From the article:
Before we begin, however, please be aware that if your pet is experiencing diarrhea, a veterinarian should first determine if an underlying medical condition exists. Pets, just like humans, get diarrhea for many reasons; you should first know what you are dealing with before you attempt to manage it. Severe diarrhea can also result in dehydration and loss of electrolytes, potentially serious issues that may require medical intervention such as intravenous fluids and electrolyte balancing solutions to resolve. Once your veterinarian gives the “all-clear” to manage your pet’s diarrhea more naturally, you can consider whether pumpkin is a viable alternative.