I updated the source code tool, and it's pretty cool, if I do say so myself. Instead of submitting suggestions via a form that emails me, you can now submit them via comments. This means you can read what anyone else suggests, you can ask questions about the code, and you're not relying solely on my good word that I will, in fact, give attribution for contributions I use as everyone else could see if I were to pass off your ideas as my own (which, of course, I would never do).

Because it's not in a form anymore, the source is now using syntax highlighting, which is easier to read. You can also now directly download the source of any page as a text file, which makes it much easier to reuse something you find here. In addition to making the tool easier for others, this will hopefully save me some time as I will no longer need to package up files and email them to people.

Now here's the coolest part: Whenever a source file references another source file, the source tool automatically creates a link to the source of the referenced file. This will make it much easier to reuse tools that use multiple files. But wait, there's more! It will also recognize SQL references to database tables, and link directly to the table in the database browser I recently made (and to which I still need to add more tables). So now pretty much everything on this site except passwords is open for anyone to see, download, reuse and comment upon.


a google search for "phpsessionid valid xhtml" currently returns 13 results, none of which explain how to produce valid xhtml with php's automatic phpsessionid. it took me a while to figure it out, so hopefully this post will show up in those results soon and help someone else out. what you need to do is put this at the beginning of your script:

ini_set( 'arg_separator.output' , '&' );
ini_set( 'url_rewriter.tags' , 'a=href,area=href,frame=src,input=src,fieldset=' );

the first part will make the automatic URL rewriting for sessions use the HTML entity &amp; rather than the default &, which is invalid XHTML. the next line will add the hidden form input (which is valid XHTML) inside a <fieldset> rather than the default, immediately after the <form> tag, which is invalid XHTML. if you don't already have them, you need to put <fieldset> tags inside all <form> tags to get forms to work with PHP sessions. this will change the appearance of your forms, but you can change it back with some CSS styling.