if ( !empty($_GET[ 'r' ]) ) { $TFILE = realpath($FOLDER . "/" . $_GET[ 'r' ]); echo 'hrm '.$TFILE."=".$FOLDER.'
'; if (strncmp($FOLDER,$TFILE,strlen($FOLDER)) != 0) { readfile($TFILE); die; } else { echo "

NOPE

"; die; } } input, http://mepage/mytest.php?r=/readme.txt outputs: hrm c:\www\mytest\readme.txt=c:\www\mytest

NOPE