Solved

Include HTTP Headers in ASP/HTML pages. How?

Posted on 2002-05-09
7
211 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
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 …
Suggested Courses

623 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