Google Blogoscoped

Forum

HTML Mystery

Cow [PersonRank 2]

Friday, October 21, 2005
18 years ago

I made this yesterday and I thought it might be worth sharing.

It's a blank HTML file (0 byte without HTML comments) but it's got text, images and rollover effects.

http://cow.neondragon.net/stuff/nocode.php

From my blog @ http://cow.neondragon.net/index.php/211-Html-Mystery

Philipp Lenssen [PersonRank 10]

18 years ago #

Hmmm... interesting...

Kevin Wallace [PersonRank 1]

18 years ago #

It's in the HTTP headers. The following header is sent:

Link: <nocode.css>; REL="stylesheet"; MEDIA="screen"

If you view http://cow.neondragon.net/stuff/nocode.css, you can see the CSS that creates the page you see.

Interesting technique; I didn't know about the Link header until now.

Brian M. [PersonRank 10]

18 years ago #

this can't be good

Jeff Atwood [PersonRank 1]

18 years ago #

HTTP/1.1 200 OK
Via: 1.1 ISA
Connection: Keep-Alive
Proxy-Connection: Keep-Alive
Content-Length: 17
Date: Sat, 22 Oct 2005 01:26:50 GMT
Age: 51
Content-Type: text/html; charset=ISO-8859-1
Server: Apache
X-Powered-By: PHP/4.4.0
Link: <nocode.css>; REL="stylesheet"; MEDIA="screen"
Keep-Alive: timeout=15, max=100

<!-- No HTML! -->

Andrew Kao [PersonRank 0]

18 years ago #

How do you add a link to the HTTP header?

Philipp Lenssen [PersonRank 10]

18 years ago #

(Sigh, I saw the "rel="stylesheet" in the http header, but the web site I was checking the http header allowed itself to be HTML-injected... so the <nocode.css> didn't show!)

Brian M. [PersonRank 10]

18 years ago #

can you link to an empty stylesheet which has headers which link to another ad infinitum?

Cow [PersonRank 2]

18 years ago #

Yeah, you guys got it. I only found out that you could use the Link header for stylesheets yesterday – it's quite a nice way of sending CSS only to Gecko or Opera 9 but I've never heard of anyone ever using Link HTTP Headers for sending stylesheets before.

The content attribute of CSS is also really cool, half the people I know aren't aware it exists or that CSS can write content.

I don't think you could get a stylesheet to link to another stylesheet and get recursion – the Link header with rel stylesheet should only make sense for HTML files.

Goh Wei Zhong [PersonRank 0]

18 years ago #

> How do you add a link to the HTTP header?

It's a PHP thing, just include <?php header('--header-content--'); ?> in the PHP file.

Badmoon [PersonRank 0]

18 years ago #

Where did the game go we can no longer get there from the states

Forum home

Advertisement

 
Blog  |  Forum     more >> Archive | Feed | Google's blogs | About
Advertisement

 

This site unofficially covers Google™ and more with some rights reserved. Join our forum!