Forum Moderators: coopster

Message Too Old, No Replies

Compact Headers on Shared Apache Server

Inserting P3P compact headers

         

GailM

3:03 am on Nov 12, 2007 (gmt 0)

10+ Year Member



I am trying to get my compact headers for my P3P privacy policy to validate using the w3c.org/P3P/validator.html on a shared Apache server. The site is built in html but can be changed to php.

I've been told I can't use .htaccess or mod_headers because I don't have a dedicated server.

I am a total newbie with any type of coding too - BUT I can follow directions.

Can anyone help?

THANKS!

Warmly,

Gail

jdMorgan

4:12 am on Nov 12, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



> I've been told I can't use .htaccess or mod_headers because I don't have a dedicated server.

No, you can't use .htaccess or mod_headers because you've got a cheesy host. There are many, many shared-server hosting providers that support these basic capabilities.

Jim

GailM

3:22 pm on Nov 12, 2007 (gmt 0)

10+ Year Member



I honestly didn't know that Jim. The two hosts I've worked with in the past didn't allow it. Assuming I don't want to move all my websites that are hosted in one account immediately - is there a way to insert the compact headers another way?

Thanks for all your help!

Gail

jdMorgan

4:29 pm on Nov 12, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You might want to look into PHP's auto_prepend feature - You might be able to use it to prepend some PHP code to each page to output the P3P header. The downside is that you'll have to parse each .html page page for the PHP code.

I'm not much of a PHP user, so hopefully someone else can help with the details.

Jim

PHP_Chimp

7:38 pm on Nov 12, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



As your host is not offering some basic things you may well find that they have limited your use of php's autoappend.
You can however use the header [uk2.php.net] function to send a http header, including your P3P one.

GailM

9:14 pm on Nov 12, 2007 (gmt 0)

10+ Year Member



How do I use the 'header' function?

I've tried using a meta tag in html to send the compact policy but it doesn't validate.

I used <meta http-equiv="P3P" content='CP="COMPACT POLICY CODE HERE"'>
at the head of the page and in the place where I put meta tags. Neither one is working.

I also tried: <meta http-equiv="P3P" content='CP="CAO DSP AND SO ON" policyref="/w3c/p3p.xml"' /> (not my compact policy)

Am I placing them incorrectly or should I be using something else? I really appreciate your help!

Gail

PHP_Chimp

9:38 pm on Nov 12, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



header('P3P: CP=COMPACT POLICY CODE HERE');
should do it, although you may need to check the exact spec [w3.org...] for the http headers