20.2 How to Read the Value of a HTTP Header?
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"];
Previous Page | Page 38 of 39 | Next Page |
Contents at a Glance (Click Here for Full Table of Contents)
- 1. WCSS (WAP CSS) Introduction
- 2. Wireless CSS and Wireless Profile CSS
- 3. Advantages of Using WAP CSS Style Sheets on Mobile Internet Sites
- 4. Disadvantages of Using WAP CSS Style Sheets on Mobile Internet Sites
- 5. Syntax Rules of WCSS
- 6. Comments in WCSS
- 7. How to Apply WCSS Styles to an XHTML MP Document
- 8. Different Types of Selectors
- 9. Div and Span Element of XHTML MP
- 10. Cascading Rules for Handling Multiple Groups of WCSS Styles Applied to the Same Element
- 11. Common Types of Property Value
- 12. WCSS Font and Text Properties
- 13. WCSS List Properties
- 14. WCSS Color Properties
- 15. WCSS Border Properties
- 16. WAP Specific Extensions to CSS
- 17. WCSS Access Key Extension
- 18. WCSS Input Extension
- 19. WCSS Marquee Extension
- 20. Matching WCSS Cascading Style Sheets to Different User Agents