Refactored from HTML to PHP.