Answer the question
In order to leave comments, you need to log in
CNC problems?
In general, the essence of the problem is this: There is a
PHP
code :
$url = explode('/',strtolower(substr($_SERVER['REQUEST_URI'], 1)));
switch($url[0]) {
case 'Главная страница': {
include 'com/top.php';
break;
}
}
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
switch($url[0]) {
case 'Какой-то обработчик': {
include 'com/form.php';
break;
}
}
Answer the question
In order to leave comments, you need to log in
Do not write a router yourself, install a ready-made one, for example Klein or Aura, it will give you some framework right away. Do you know how to work with composer?
So your router should be in index.php, and depending on what came into it, it should call one or another PHP file. Those. if a POST request comes in and the address specifies a form handler page, then just call the form handler file.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question