2
Good evening, someone with more affinity in PHP could explain the following code?
PS: I am starting the studies so I already apologize if the doubt is frivolous.
<?php
if (isset($_GET['pagina'])) {
$do = ($_GET['pagina']);
}else{
$do = "inicio";
}
if (file_exists("paginas/" .$do. ".php")) {
include("paginas/" .$do. ".php");
}else{
echo "Página não econtrada";
}
?>
Short and thick, it’s a big security problem.
– bfavaretto
Basically it executes the php file that is passed in the url. Including files that any person on the internet should not be able to have run.
– bfavaretto
@bfavaretto is more conducive to that, yes, but I think if the programmer knows it does, only pages even inside the directory
páginas
there is no Prob. Ps: I also would not do so clear– Miguel