hey guys, i know it's not the best way of doing this but the whole thing is just a little project which doesn't need anything more difficult.
Ben domain.com? P = klasör / alt klasör / vb gibi benim url ile birlikte dizin adlarını geçiyorum
Ben dir varsa kontrol etmek için en iyi yol arıyorum ve ben (en azından) tür hiyerarşisinde kadar gidiyor engellemek istiyoruz.
şimdi ben (neredeyse) çalışmaları şu anda ne yapıyorum, ancak ben bunun için çok daha iyi ve daha kolay ve daha kısa yolu var:
if(isset($_GET['p'])) {
if (realpath($_GET['p'])) {
if (substr(PATH, 0, 1) == "" || substr(PATH, 0, 1) == "/" || substr(PATH, 0, 2) == "./" || substr(PATH, 0, 3) == "../") {
print "directory is forbidden!";
} else {
define(PATH, $_GET['p']);
}
} else {
print "directory does not exist!";
}
} else { define(PATH, "root"); }
ne yapardınız?