What are some of the reasons why I get really bad flatulence after eating and how can I prevent it?

Digestion. Gas is caused by bacteria in the colon that breaks down certain food products. Often this is caused by carbohydrates or even high-fiber, cellulose-containing vegetables. Other times it is caused by lack of specific enzymes...For example lactase in people with milk-digestion problems. See if you can narrow it down. In the meantime, products like beano and simethicone (gas-x) can help.
Be a detective! Agree with dr. N: time to hunt down more clues. Some prime [gassy] suspects: added fiber, whole grains, beans, garlic, onions, dairy, wheat/gluten, some veggies [artichokes, asparagus, broccoli, brussel sprouts, cabbage, carrots, cauliflower, celery, cucumbers, green peppers, peas, potatoes, radishes], caffeine, artificial sugars [nutrasweet, splenda, sorbitol], some drinks [beer, wine, diet soda].