PHP switch with GET request

后端 未结 6 2100
南旧
南旧 2021-02-03 16:12

I am building a simple admin area for my site and I want the URLs to look somewhat like this:

http://mysite.com/admin/?home
http://mysite.com/admin/?settings
htt         


        
6条回答
  •  没有蜡笔的小新
    2021-02-03 16:36

    The PHP code:

    switch($_GET){
        case !empty($_GET['home']):
           // code here
        break;
    
        case !empty($_GET['settings']):
             // code here
        break;   
    
        default:
             // code here
        break;
    }
    

提交回复
热议问题