All Posts Mentioning ‘php’

PHP, Content Negotiation, and (X)HTML Pretty Printing

Sunday, January 4th, 2009

The Goal
To have a functional, 100% validated website that serves documents in the most appropriate format possible for a given user agent. The resultant code generated will be well formatted and properly indented.
Miscellaneous Realities
Some user agents don’t render application/xhtml+xml documents, so they should be served text/html documents. XHTML should (by specification) be served with the [...]

GeoIP for Wordpress Counterize Plugin

Wednesday, November 12th, 2008

This is a bit of an esoteric subject, but if you use Wordpress and are looking for a good statistics plugin, try Counterize II. If you’re looking for an even better statistics plugin, keep reading.
Steffen Forkmann’s Counterize II plugin for Wordpress is pretty good, but as of 2.13, it stopped logging IPs. For this reason, [...]

A Wordpress Comments Hack

Wednesday, November 7th, 2007

If you allow open comments on your blogs, and ask for a website to post a comment, some people will leave junk to get around it. So, it’s best not to require a website if you are letting the public comment on stuff. However, perhaps you’d like to have their hostname (there likely won’t be [...]

Using PHP to Serve M3U, CSS, etc.

Sunday, November 4th, 2007

Background on MIME Types
I got this idea a while back when I was working on an XHTML content negotiation header. What it did, basically, was conditionally serve an XHTML document with the application/xhtml MIME type if you were using firefox, and it served it as text/xhtml if you were using IE (*shivers*).
The essential component of [...]

XHTML or HTML5? Summary of XHTML’s Current State

Saturday, June 10th, 2006

A look at the various problems and benefits of XHTML. The article makes a case for using XHTML as opposed to HTML4 as advocated by some developers. The article includes a discussion of W3C’s recommendations and how realistic they are to implement at this point.
W3 Says XHTML.
That’s a pretty half-baked reason to chose one over [...]