When I link to a file in a directory, I want to open that file as a param in a php program.
For example, I have a directory temp
, and files aa.txt
, bb.txt
, and test.php
. When I link to aa.txt
it should be handled like test.php?f=aa.txt
.
What do I change in the .htaccess file?
the code in the test.php
<?php
$f=$_GET['f'];
if(@file_exists($f)){
$inhoud = file_get_contents($f);
}else{
$inhoud = "Not found\n";
}
print "hallo <hr>".$inhoud;
?>