Yea, PHP isn't going anywhere but UP. ASP is very powerful, but because it's so proprietary it's not nearly as popular as PHP.
Are you wanting to write a tracking application in PHP? Google Analytics is great for tracking web visitor activities. Then there's more professional services like Omniture, WebTrends, StatCounter, etc.