modularize php+html generation, fix sql 'LIKE %%%%' issue, htmlout now writes iteratively like phpout