Problem with CNC?

0 like 0 dislike
119 views
In General, the problem is this:
There is a code

PHP:

$url = explode('/',strtolower(substr($_SERVER['REQUEST_URI'], 1))); switch($url[0]) { case 'Home': { include 'com/top.php'; break; } }


.htaccess

RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L]


He actually does CNC.

So, let's say I made a ajax request and sent it to the handler there is a certain, the fact that he has already opened the form, that is, a blank page with by the handler, while ajax magically stops working and this is most likely because of CNC, because to use the same form handler, you need to enter it like this:
switch($url[0]) { case 'Some handler': { include 'com/form.php'; break; } }

And every time you enter the handler in these fields, do not think in Feng Shui...
I do not like it, some handlers, to avoid the system?

Sorry for the bump on the forehead due to feyspalm, I'm still a newbie.
But need it learns to understand why I love it!
Sir, do not pass by this question!
Thank you in advance.
by | 119 views

1 Answer

0 like 0 dislike
Do not write the router yourself, put prepared, for example, Klein Aura or he will ask you some frame from. With composer able to work?

And every time you enter the handler in these fields, do not think in Feng Shui...

So you have a router needs to be in index.php and depending on what's in neg came he should call a particular PHP file. Ie, if we receive a POST request and the address specified page form handler, then just call the file handler form.
by

Related questions

0 like 0 dislike
1 answer
asked Aug 14, 2019 by lietryit
0 like 0 dislike
1 answer
asked Jul 15, 2019 by lietryit
0 like 0 dislike
1 answer
asked Jul 6, 2019 by lietryit
0 like 0 dislike
1 answer
asked Jul 5, 2019 by lietryit
0 like 0 dislike
1 answer
110,608 questions
257,187 answers
0 comments
40,796 users