Added PHP functionality in accordance to spec (no AJAX etc).