N
N
NastyaG2016-11-04 17:50:13
PHP
NastyaG, 2016-11-04 17:50:13

How to make CNC in PHP?

Hello!
The question arose: how to organize CNC?
I have an allEmployees.php page. It displays a table with data and below them you can filter. The filter parameter is selected, the button is pressed, the page is reloaded and we get the updated data. But the problem is this: how to make readable links?
Now I have this: localhost/allEmployees.php?dep=development
How to make the page address change when the filter is sent, for example, to localhost/allEmployees.php/dep

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Eugene Budnik, 2016-11-04
@egenik

You need to create a .htaccess file with the following content:

RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f

RewriteRule ^allEmployees.php/?(.*)$ allEmployees.php?dep=$1 [L,QSA]

Where (.*) is a regular expression that will extract the value "development" from localhost/allEmployees.php/development and replace $1

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question