Replaced headers loop. Typo and added www-form-urlencoded content-type for PHP and HTML forms