How would I easily find the current url and all of the GET paramaters in that URL with PHP? I want to track which GET paramaters are being passed to the current url. If somebody could give me the PHP command to do this, then that would be great!
Thanks!
Here is my code:
<?php
$filedir = './';
$filename = $_GET['file'];
//security check
if(strpos(realpath($filename), PATH_TO_VALID_MP3s) !== 0) { die('bad path!'); }
$path = $filedir . $filename;
if (!is_file($path) OR connection_status() != 0)
{
exit();
}
ob_end_clean();
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Expires: '. gmdate('D, d M Y H:i:s', mktime(date('H')+2, date('i'), date('s'), date('m'), date('d'), date('Y'))).' GMT');
header('Last-Modified: '. gmdate('D, d M Y H:i:s').' GMT');
header('Content-Type: application/octet-stream');
header('Content-Length: '. @filesize($path));
header('Content-Disposition: attachment; filename="'. $filename .'"');
header('Content-Transfer-Encoding: binary');
if ($file = @fopen($path, 'rb'))
{
while (!feof($file) AND connection_status() == 0)
{
echo fread($file, 1024 * 8);
}
flush();
}
@fclose($file);
?>