Answer the question
In order to leave comments, you need to log in
How to make it so that it automatically downloads from the folder those pages (if any) that are in the folder?
The guys need help on how to make it so that it automatically downloads from the folder those pages (if any) that are there.
example wrote: mysate.ru/page and he loaded the data from the page.php file,
I threw it here (mechanical box :)), but if there is a better option, I ask the studio
$armor = array('index','lol');
foreach ($armor as $key) {
if ($Page == $key) include('page/'.$key.'.php');
}
Answer the question
In order to leave comments, you need to log in
Hello zero. I haven't seen this in a while.
Use templating + normal routing
This is bullshit. Terrible bullshit.
I understand that if the user entered site.my/page, then you need to give the page.php file? Why not make a page folder, and put index.php in it, and then when you enter site.my/page, the index.php page from this folder will be requested.
But this is also a solution.
And if it’s really so important (don’t do it!) That that file be called page.php, then in index.php put a script that reads page.php and inserts it into index.php, e-my, what I advise. If it is really NECESSARY, then you should think about the logic of your application.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question