- // need to add query string to end of PHP_SELF to match REQUEST_URI
- //
- if ( sqgetGlobalVar('QUERY_STRING', $query_string, SQ_SERVER) && !empty($query_string) ) {
- $php_self .= '?' . $query_string;
- }
+ // first try $_SERVER['PHP_SELF'], which seems most reliable
+ // (albeit it usually won't include the query string)
+ //
+ $request_uri = '';
+ if (!sqgetGlobalVar('PHP_SELF', $request_uri, SQ_SERVER)
+ || empty($request_uri)) {
+
+ // well, then let's try $_SERVER['REQUEST_URI']
+ //
+ $request_uri = '';
+ if (!sqgetGlobalVar('REQUEST_URI', $request_uri, SQ_SERVER)
+ || empty($request_uri)) {
+
+ // TODO: anyone have any other ideas? maybe $_SERVER['SCRIPT_NAME']???
+ //
+ return '';
+ }