Rewritten with CURL for better compatibility with some php installations.