24 ways..

Posted on January 26, 2006
Filed Under Tech, Web development | 1 Comment

..to impress your friends. Some interesting web developer thingies.

Fetching HTTP request headers in PHP

Posted on January 17, 2006
Filed Under Tech, Web development | Leave a Comment

Well, that was easy. I was looking for a way to fetch HTTP request headers in PHP, for the implementation of Conditional GET in an RSS module. PHP has this function, apache_request_headers(), which returns an array containing all the headers you could possibly need. Problem solved!

But; when the software you’re working on (in my case a content management system) has to work on both Linux/Apache and Windows/IIS servers, there’s a bit of a problem: Apache-functions won’t work if there’s no Apache to work with. Fortunately, you don’t need functions to fetch specific headers: PHP has already gathered them for you.

When a client requests a PHP-driven page on your web server, you can check for request headers in the $_SERVER array. For instance, the If-Modified-Since header is stored in $_SERVER['HTTP_IF_MODIFIED_SINCE']. This will work for every header you can think of: PHP just converts them all to the right variable. A header This-One-Doesnt-Exist becomes $_SERVER['THIS_ONE_DOESNT_EXIST'] in PHP code. Just like that!

Wanna laugh?

Posted on January 13, 2006
Filed Under Blogging | Leave a Comment

Try this one, the best blonde joke ever!

Python in 10

Posted on January 13, 2006
Filed Under Tech, Web development | Leave a Comment

A good programmer has knowlegde of several languages. Need to learn Python? It takes 10 minutes to do it.

Need a handbook?

Posted on January 13, 2006
Filed Under Tech, Web development | Leave a Comment

When you’re a web developer, as I am, you might think this one is useful.