<p>I have the Profile, CCK, and Views2 modules installed on a Drupal 6 site.  I added a string field to the user profile.  I can filter easily on preset values, thru the Views GUI builder, really nicely.  However, I'd like the filter criteria to be dynamically set based on other environment variables (namely the <code>$_SERVER['SERVER_NAME']</code>).</p>

<p>Is there a basic 'How-to-write-a-custom-drupal-views-filter' somewhere out there?  I've been looking thru the documentation, but it's not obvious to my simple mind on how to do it.</p>

There is the possibility, having looked at the sort of filters installed for my own site, that filters have to be based on some database field, in which case what you're trying to achieve is not possible.  It appears that the filters provide the WHERE clause to the generated SQL query.
Having said all that, if you want to pursue it further, your best bet is to start with a module that already provides filters for Views.  There are filters provided with Views for the Node module; alternatively, you could look at the
audio module
which also provides some filters.  Additionally, posting to the Drupal forums or support list may turn up another module that will allow you to achieve what you're attempting.