Solved

Include HTTP Headers in ASP/HTML pages. How?

Posted on 2002-05-09
7
209 Views
Last Modified: 2013-11-18
I recently made our site P3P compliant, and a requirement is to follow the procedure I am enumerating next:

INTERNET INFORMATION SERVER
1. Open the IIS Administration Console.
2. Open the Properties screen for the webserver.
3. Click on the 'HTTP Headers' tab.
4. Click 'Add' in the 'Custom HTTP Headers' area.
5. A new window appears.
6. Type 'P3P' (without quotes) in the 'Custom Header Name' text field.
7. Copy and paste the following string
 
CP="NOI DSP COR NID"
 
into the 'Custom Header Value' text field (this time include the quotes).
 
8. Select OK and exit out of the IIS Admin.

I send this procedure to my ISP to do it and they replied that they are not able to do this, and in return I should include these headers in my ASP page. So, how do I include this CP=" ... " P3P header in my ASP?

Thank you
GM
0
Comment
Question by:gm395
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
7 Comments
 
LVL 23

Expert Comment

by:b1xml2
ID: 6999331
<%
 Response.Buffer = True
 Response.AddHeader "CP" ,"whatever value"
%>

Syntax is:
Response.AddHeader <header_name>,<header_value>

Caution:
Adding headers can be successfully done if no content has yet to be sent to the client.

Recommendation:
 Set the Response.Buffer = True to ensure that the entire page gets sent as one and not in chunks.
0
 
LVL 23

Expert Comment

by:b1xml2
ID: 6999335
Here, having read what you require:
==================================
<%
Response.AddHeader "P3P","CP='NOI DSP COR NID'"
%>
0
 
LVL 23

Expert Comment

by:b1xml2
ID: 6999354
As for HTML Pages,
<html>
<head>
<meta name="P3P" content="CP='NOI DSP COR NID'">
<title>My Page</title>
</head>
<body>
</body>
</html>
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:gm395
ID: 6999435
I will check it tomorrow at work and let you know. Thanks in advance.
0
 
LVL 1

Author Comment

by:gm395
ID: 7003182
The problem with the ASP solution you have given me is the fact that it uses single quotes, whereas I require double quotes. So the header set is the:

P3P: CP='NOI DSP COR NID'

instead of

P3P: CP="NOI DSP COR NID"

The code I am using at the beginning of my ASP file is:

<% @language=vbscript %>
<%
Response.Buffer = True
Response.AddHeader "P3P","CP='NOI DSP COR NID'"
%>

and the error I get is:

Message: Compact Policy must be quoted by double quotation marks ("). Single quotation marks are not allowed.

Any help with this? Additionally, if I use the HTML tag, it does not seem to work, in an ASP file (which at the end of the day returns some HTML code).

Thanks
0
 
LVL 23

Accepted Solution

by:
b1xml2 earned 100 total points
ID: 7003197
Response.AddHeader "P3P","CP=""NOI DSP COR NID"""

You can use the double quotes then =)
0
 
LVL 23

Expert Comment

by:b1xml2
ID: 7003199
i doubt that the meta tag would work in the same way as the AddHeader as that is a HTTP Header whereas the meta tag's success depends on the browser implementation. I would say that you'd have to use ASP for this task.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Mobile apps - web/native or hybrid? 1 65
Navigation Menu Does Not Show on iPad 4 30
Two decimal 5 25
HTML or/and CSS codes to construct numbered paragraphs. 5 19
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question