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

后端 未结 3 1490
时光取名叫无心
时光取名叫无心 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:45

    In that repo, take a look in public/.htaccess This is where the magic happens. It's the web server which actually does the job of mapping the url to parameters. The code looks like this:

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

    What that's doing is saying any url that looks like category/ will be rewritten to index.php?page=category&cat=

    So index.php actually handles all those requests, and has the correct GET value - even though the url used is different.

提交回复
热议问题