HTDB : Docs : Designer's Guide : Environment
About
Overview
Philosophy
Features
News
Download
Help Us!

Docs
Overview
Designers
Language
Environment
C-Functions
S-Functions
Developers
Roadmap
Architecture

Community
Powered By

[home]
Apache Environment

All existing webserver environment variable are made available to script writers and programmers in variable with the "cgi->" prefix.

${cgi->forwarded}
${cgi->http_x_real_ip} 3.133.144.140 
${cgi->http_x_forwarded_for} 3.133.144.140 
${cgi->http_host} htdb.org 
${cgi->http_x_nginx_proxy} true 
${cgi->http_connection} close 
${cgi->http_accept} */* 
${cgi->http_user_agent} Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot-at-anthropic.com) 
${cgi->http_accept_encoding} gzip, br, zstd, deflate 
${cgi->server_signature}  
${cgi->server_software} Apache/2.4.52 (Ubuntu) 
${cgi->server_name} htdb.org 
${cgi->server_addr} 127.0.0.1 
${cgi->server_port} 80 
${cgi->remote_addr} 127.0.0.1 
${cgi->document_root} /mnt/data/vhosts/htdb.org/htdocs 
${cgi->request_scheme} http 
${cgi->context_prefix} /htdb 
${cgi->context_document_root} /usr/local/htdb/bin/htdb 
${cgi->server_admin} del-at-adjective.com 
${cgi->remote_port} 40586 
${cgi->gateway_interface} CGI/1.1 
${cgi->server_protocol} HTTP/1.0 
${cgi->request_method} GET 
${cgi->query_string}  
${cgi->request_uri} /htdb/docs/scripting/environment.html 
${cgi->script_name} /htdb 

HTDB Environment

In addition to the server environment, HTDB adds several variables to the in-memory store. Yes, all these should be prefixed with something that makes sense, and eventually will be.

${db} docs/scripting
${page} environment.html
${pageResource} docs/scripting_index.html
${logResource} docs/scripting/environment.html
${_session_int} 0
${_db_timestamp} 1722066237
${_timestamp} 1722066237
${_current_date} 27Jul2024
${_current_time} 7:43 AM
${_current_year} 2024
${_current_day} 27
${_current_hour} 7
${_current_min} 43
${_current_sec} 57
${_current_weekday} Sat
${_current_monthnum} 07
${_current_mon} Jul
${_current_month} July
${_current_pid} 463398
${cgi->http_port} 
${cgi->http_protocol} http://
${_hit_count} 15453
   
15,453 impressions