'One of these is that when you add a favorite in Internet Explorer, the browser searches for the web site's "favorites icon" - or favicon.ico. (For more info, see www.favicon.com.) This is how your favorites end up with branded icons for some of the web sites you go to, and how http://www.msn.com/ and other web sites have their icon in IE's address bar.
'Note that you can use a different ICO file if you prefer... favicon.ico is only the default. You can override it with the following tag:
'Well, if the browser searches for this file and can't find it, you can capture the event with a custom 404 page. I simply created a table to increment a counter:
CREATE TABLE FavIcon
(
cnt INT
)
'Then a stored procedure to handle the updates:
CREATE PROCEDURE FAQ_bumpFavIcon
AS
BEGIN
UPDATE FavIcon SET cnt = cnt + 1
END
'And In my custom error page for 404 errors, I have the following code:
<%
' ... valid connection "conn" established
qs = lcase(Request.ServerVariables("QUERY_STRING"))
if right(qs,12)="/favicon.ico" then
conn.execute("EXEC FAQ_bumpFavIcon")
end if
' ...
%>
'I'll leave it as an exercise to the reader how I display it on the home page. For most people, this should be pretty self-explanatory. :-)