#include #include #include #include #include using namespace cgicc; int main () { using namespace std; cout << ("Content-type: text/html;charset=utf-8\n\n") << endl; cout << "hello World!" << endl; #if 0 Cgicc formData; // Output the HTTP headers for an HTML document, and the HTML 4.0 DTD info //cout << HTTPHTMLHeader() << HTMLDoctype(HTMLDoctype::eStrict) << endl; cout << html().set("lang", "en").set("dir", "ltr") << endl; // Set up the page's header and title. cout << head() << endl; cout << title() << "GNU cgicc v" << formData.getVersion() << title() << endl; cout << head() << endl; cout << body() << endl; //std::cout << "Content-type:text/html;charset=utf-8\r\n\r\n"; // Start the HTML body // Start the HTML body //std::cout << "\n"; //std::cout << "使用 GET 传递参数\n"; form_iterator fi = formData.getElement("spm"); if( !fi->isEmpty() && fi != (*formData).end()) { std::cout << "spm:" << **fi << std::endl; } std::cout << "
\n"; fi = formData.getElement("id"); if( !fi->isEmpty() && fi != (*formData).end()) { std::cout << "id:" << **fi << std::endl; } std::cout << "
\n"; fi = formData.getElement("cm_id"); if( !fi->isEmpty() && fi != (*formData).end()) { std::cout << "cm_id:" << **fi << std::endl; } std::cout << "
\n"; fi = formData.getElement("abbucket"); if( !fi->isEmpty() && fi != (*formData).end()) { std::cout << "abbucket:" << **fi << std::endl; } #endif return 0; }