# include "cgi_utils.hpp" int main () { std::vector split_str; std::vector sub_split_str; std::vector::const_iterator it; std::string input; std::string http_header; std::string http_body; std::cin >> input; http_body = HTML_BODY_TOP; http_body += fill_env("REQUEST_METHOD", "h3"); split_str = split(input, "&"); for (it = split_str.begin(); it != split_str.end(); ++it) { sub_split_str = split(*it, "="); http_body += "

"; http_body += sub_split_str[0]; http_body += "

"; http_body += "

"; http_body += sub_split_str[1]; http_body += "

"; } http_body += HTML_BODY_BOTTOM; http_header = "Content-Type: text/html; charset=UTF-8" CRLF; http_header += "Content-Length: "; http_header += itos(http_body.size()); std::cout << http_header << CRLF CRLF << http_body; return 0; }