static int hw_handle_req ( request_rec *r )
{
const char* ua = ap_table_get(r->headers_in, "User-Agent" );
if (!ua || !*ua) ua = "No User-Agent.";
/* set and send headers */
r->content_type = "text/html";
ap_send_http_header( r );
/* send the content body */
ap_rputs( "<HTML><HEAD><TITLE>Hi. Welcome!</TITLE></HEAD><BODY>\n" , r );
ap_rprintf( r, "<P>%s <br>Using Browser: %s</P>\n", greeting, ua );
ap_rputs( "</BODY></HTML>\n", r );
return OK;
}
static const handler_rec hw_handlers[] = {
{ "hw-app", hw_handle_req },
{ NULL }
};
Example 3: Apache 1.3 response handler.
Back to Article