how to create query string for $_GET without HTML form and URL?

后端 未结 3 1521
时光取名叫无心
时光取名叫无心 2021-01-23 12:23

Imaging we are at home page: www.example.com

we have a hyperlink on this page.

Pizzas

when

3条回答
  •  既然无缘
    2021-01-23 12:43

    well he means he don't know as to capture the $_GET values of www.example.com/category/Pizzas in php source code.

    this is all done with apache mod rewrite or nginx:

    on your index.php page you can define it:

    
    

    php will get this:

    www.example.com/index.php?page=category&cat=Pizzas
    

    and user will see www.example.com/category/Pizzas on URL (thanks to mod rewrite):

    RewriteEngine on
    RewriteBase /
    RewriteRule ^category/(.*)$ index.php?page=category&cat=$1 [L]
    

提交回复
热议问题