Visit our Sponsors
If you've ever needed to access the HTTP request headers from a web page you've found that it's nearly impossible. That's why we created this JavaScript library. By adding a single line of HTML code you can now use JavaScript to access all but four of the HTTP headers. Those four are already built into JavaScript so you aren't missing out on anything.

<SCRIPT LANGUAGE="JavaScript" SRC="http://www.searchnc.com/cgi-bin/gethttp"></SCRIPT>

The functions available in this script are:

getHttp.length() returns the number of headers
getHttp.header(index) Zero based index into the headers array
getHttp.data(index) Zero based index into the header values array


The four headers that are not returned and their JavaScript replacements are as follows:

HTTP_COOKIEdocument.cookie
HTTP_USER_AGENTnavigator.userAgent
HTTP_HOSTlocation.hostname
HTTP_REFERERdocument.referrer




JavaScript code example:

for (var j = 0; j < getHttp.length(); j++) {
   document.writeln(getHttp.header(j) + " := " + getHttp.data(j) + "<br><br>");
}















Back to the main page