Forum Moderators: open

Message Too Old, No Replies

How do I add HTTP P3P Headers to my HTML files?

I can't use htaccess as I don't have 'mod_headers' enabled

         

tomld2

6:12 pm on Mar 9, 2004 (gmt 0)

10+ Year Member



I have an apache server and I am trying to add my P3P compact privacy policy headers to all of my HTML pages. No matter what I do, I can not get the P3P policy code to show up in a header viewer. Here is my policy code:

CP="ALL DSP COR PSAa PSDa OUR NOR ONL UNI COM NAV"

I've tried adding this code directly to my HTML pages:
<?php header("P3P: CP="ALL DSP COR PSAa PSDa OUR NOR ONL UNI COM NAV");?>

Doesnt work...

I've tried using the INCLUDE function and adding this code to my HTML pages...
<?php include_once("privacy.php");?>

Doesnt work...

I've tried this code:
header('P3P: CP="ALL DSP COR PSAa PSDa OUR NOR ONL UNI COM NAV"');

Doesnt work...

I've tried adding the code at the very top of my HTML pages, below the <HTML> tag, below the <HEAD> tag, and nothing works.

What do I have to do to successfully add my P3P HTTP headers to all of my HTML pages?

By the way, I don't have mod_headers enabled, so I can't do it with htaccess.

Thanks
Tom

zair

10:30 pm on Mar 9, 2004 (gmt 0)

10+ Year Member



try <? include "header.php";?> in the HEAD tag.

We're running an apache server, and that works fine for us, but then we're adding a visible header to our HTML pages, and I'm not sure if that's what you want... :)

Good luck,
Tobyn

EDIT: Here's something else I found online that may help... here [us2.php.net]

grahamstewart

8:35 am on Mar 10, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



<?php header("P3P: CP="ALL DSP COR PSAa PSDa OUR NOR ONL UNI COM NAV");?>

This is what you need to add the p3p header to a PHP file.
It must appear before any other output.

I notice you are talking about html pages?
Typically *.html page will not be parsed for any php content. Usually only *.php files are parsed.

DrDoc

4:29 pm on Mar 10, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



<?php header("P3P: CP=\"ALL DSP COR PSAa PSDa OUR NOR ONL UNI COM NAV\"");?>

You were missing the ending quote, and you also didn't escape the double quotes inside the string. That's the right way of doing it, and that should work. If it doesn't, check your headers on searchengineworld.