简体   繁体   中英

How to store php page name in variable?

I have a php page (running locally):

http://localhost/webpagefolder/home.php

When a different page is clickedon the URL changes to reflect it. So it now becomes:

http://localhost/webpagefolder/home.php?here=delivery

because I have selected the delivery page.

How would I store the part after the = in a variable?

Something like $name = delivery (or whatever is displayed after the = )

Thanks in advance

In PHP all the GET-variables are stored in the $_GET super global. In your example $_GET['here'] should contain 'delivery'.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM