24 June 2007

Vista Enable Microphone Recording

I wanted to make a recording but there were no recording devices available in Vista's Sound control panel applet. Then I found out that I had to select Show Disabled Devices menu item in the Recording tab sheet's context menu to see the microphone before I could enable it. Grrr! Prior to this problem, I'd never seen a context menu in a tab sheet. Also, it seems silly to have the option to hide audio devices; most users would only have a small number of playback and recording devices in the first place.

17 June 2007

More PHP Web Boilerplate

Added a more PHP Web boilerplate text to save more typing. The page structure is now simplified to …

<?php
include "php/xhtml_mimetype.php";
$doc_title = "It Mostly Works";
include "php/header.php";
?>

…

<?php include "php/trailer.php" ?>

16 June 2007

Apache Blank Error Dialog on Vista

Whenever I restart my Vista computer after installing Apache 2.2, I see a error dialog with no message or icon. Repairing the installation didn't fix the problem.

After the usual ten minutes of head-scratching and searching, it turns out that the Apache installer creates a task in the Windows Startup folder called Apache Monitor, which refers to ApacheMonitor.exe. This is Windows taskbar applet which, I guess, allows you to monitor the status Apache services. Since I only run Apache on my computer for software development, I don't particularly care about running this applet and I removed it from the Startup folder. When I restarted my computer again, the blank error dialog is no longer displayed.

Investigating further, I found that this program doesn't work in Vista.

12 June 2007

XHTML using PHP

Introduction

Started using PHP for my website to generate static pages and save myself a lot of cutting-and-pasting each time I made a new page; could have used Apache's Server-Side Include feature but I intend to write some interactive pages in the future. Here's the changes I've made so far:

XHTML / PHP File Structure

The structure of my XHTML / PHP files follows:

<?php include "php/xhtml_mimetype.php"; ?>
<html … >

<head>
<title>Title Text</title>
<?php include "php/head.php"; ?>
</head>

<body>
<?php include "php/header.php" ?>

…

<?php include "php/trailer.php"; ?>

</body>

</html>

While HTML tags are static, I left them in the XHTML file so that a text editor can match the opening and closing tags.

xhtml_mimetype.php

The xhtml_mimetype.php file generates the HTTP header and writes the XML declaration and DOCTYPE. See Serving XHTML with the correct mime type using PHP by Neil Crosby on how to generate headers for browsers that can and cannot support XHTML (such as MSIE6 and MSIE7).

head.php

head.php generates META and LINK tags.

header.php and trailer.php

header.php and trailer.php contain static boilerplate XHTML text and a function to write the last modified date.

.htaccess

Added PermanentRedirect directive for pages that are now generated using PHP. The rule is currently applied on a file-by-file basis until I have converted all my files from HTML or XHTML to PHP.