Actually, Derek, this still won't provide you with the FULL URL.
There is no hostname being included in your example, nor is there a $HTTP_ENV_VARS[QUERY_STRING] (at least not in PHP4.0.3p1).
Try:
$url = 'http://' . $HTTP_HOST . '/' . $PHP_SELF . '?' . $HTTP_SERVER_VARS[QUERY_STRING];
or
$url = 'http://' . $SERVER_NAME . ':' . $SERVER_PORT . '/' . $REQUEST_URI;
or any combination of the above.
Hope this helps! 🙂
-Rich