1
If I access a page like for example http://localhost/? color=blue
Using the following GET:
<?php echo ($_GET["cor"]) ; ?>
The name will be printed Blue.
It is possible to make instead of appearing the name "Blue", be pulled a include?
Example: If the person type: http://localhost/? color=Green
Instead of being printed only the word "Green", will be printed a
<div>
that is inside file that was pulled for include, example (green.php):
<div>A cor selecionada foi <b>verde</b> </div>
The question is simple, it is possible to do a GET pull a include?
The main problem of your method, is that the included file will be within the scope of the function, and all global variables that need to be used will have to be declared as global, in terms of security mine also checks if the file exists before giving the include, but if you want something more robust, just create an array with all the options allowed, but personally I find it unnecessary, since fileexists does not confirm remote files...
– Jader A. Wagner
Yes. This is true. But in general the problem lies in the fact that he wants to do so. As he did not explain what he wanted, I made this example to show.
– Mauro Alexandre