Learning something always goes together with making mistakes and learning from those. It is even better if you can learn from other peoples mistakes!
If you are a php-programmer you might want to take a look at the following site:
They discuss poorly coded pieces of php-code. They do not only have a laugh at it, thats easy, but also analyse the code and explain why you should avoid certain structures and give you better options. Go check it out!
I find it very amusing that http://thedailywtf.com/ wasn’t enough for all the bad php code out there, enough to let a php specific source rise.