0

I'm using the following in my php code:

$file="query.txt";
$f=fopen($file,'a');
fwrite($f,"Query String:".$_SERVER['QUERY_STRING']."\n");
fclose($f);

It never returns anything. I'm simply trying to record the queried url when someone visits (i.e. http://example.com/index.php?q=string. Other $_SERVER fields seem to work just fine, it only seems to be the query string that doesn't work. Maybe there's something I need to setup in my .htaccess?

I'm hoping someone has an answer to how to get this to information to show.

4

1 に答える 1

1

これで問題は解決しました。

$_SERVER['REDIRECT_QUERY_STRING']

https://stackoverflow.com/a/11618256/1125006からのソリューション

于 2013-01-01T08:53:40.690 に答える