HTTP headers when css @import

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
sparkle
Forum Newbie
Posts: 7
Joined: Thu Aug 24, 2006 9:14 am

HTTP headers when css @import

Post by sparkle »

Hello everyone.

I need to include a dynamic css file from another server. I can do this with either @include or <link>.
However, if I enter the url of the css file into my browser's address bar, I can also see the css code.

How in the world can I distinguish between the two requests? I know they are very different things in context... Is there any difference between the http request that a browser sends when you enter a URL and the http request that it sends when requesting an included css file?

This would be great for sharing resources and attributing copyright. Anyone knows anything about this? I tried comparing the $_SERVER array, but there is absolutely no difference, and I don't know where else to look.

Thanks
sparkle
Forum Newbie
Posts: 7
Joined: Thu Aug 24, 2006 9:14 am

Re: HTTP headers when css @import

Post by sparkle »

There is a firefox extension, live http headers.

The browser actually sends a Referer header when requesting the css via @import. That header contains the value of the html page that contained the @import. When I request the css manually, that Referer header is not set. However, PHP does not read it.

How can I read the HTTP headers in php, other than $_SERVER??
Post Reply