Welcome to Developer's Home Wednesday, April 23, 2014
Home - DevelopersHome.com

How to Read the Value of a HTTP Header?


Preferences - Do not show ads

To read the value of a HTTP header, you need to use a server-side technology like ASP, Java Servlet, JSP, Perl, PHP, etc.

For example, to read the user-agent header value and store it into a variable uaheader with JSP, use the following code:


String uaheader = request.getHeader("user-agent");


For ASP (VBScript), use the following code to read the user-agent header value:


dim uaheader
uaheader = Request.ServerVariables("http_user_agent")


For ASP (JScript), use the following code to read the user-agent header value:


var uaheader = Request.ServerVariables("http_user_agent");


For PHP, use the following code to read the user-agent header value:


$uaheader = $_SERVER["HTTP_USER_AGENT"];


Page 38 of 39 Previous Page | Next Page
Contents at a Glance
Print this Web Page | | Back to Top
Custom Search

Feedback Form (Expand)

What do you think about this web page?






WCSS Tutorial Table of Contents WCSS Tutorial Contents at a Glance Preferences - Change Color Scheme Preferences - Do Not Show Ads Previous Page Next Page