Let's say I have a file such as index.php that requires a process like this one URL:
index.php? Cat = 1 & sub = 2 & amp; Id = 3 Now I have to have a good URL for that, which will look like this:
index.php / cars / bmw / x3 1, when I go to index.php / cars, how to the URL database Reaches, searches for cars, catches the relevant ID of '1', and maps it to URL?
This site is available on your webserver in your .htaccess file in PHP / MySQL
Place this code in the DocumentRoot:
Riveting on the Rev. Raul ^ index.php / cars /(.+)$ /index.php?carName=$1 [QSA, L, NC] that call to your index.php / query / query URL in whatever url comes with carName.
Then write a MySQ in your index.php to query the database from the L query, choose something like this: * cars_table where name = $ _ request ["pronoun"]; And you will be able to retrieve the matching car records.
However, as above is subject to attack of SQL SQL injection, so it is better to use the prepared SQL statement or to put Http request value for direct inquiry instead of DB.
Comments
Post a Comment