PHP not printing current URL

This question already has an answer here:

  • Get the full URL in PHP 28 answers

  • You are mistaking $_SERVER['REQUEST_URI'] for $_GET['url']

    $_GET['URL'] is a get statment .. Meaning you need to pass a variable through the URL IE http://example.com?URL=myurl

    To get the current URL .. Simply use echo $_SERVER['REQUEST_URI'];


    $_GET will get you the get parameters, not the entire url. Use $_SERVER['REQUEST_URI'] for that.

    链接地址: http://www.djcxy.com/p/42298.html

    上一篇: 从URL获取数据而不需要变量

    下一篇: PHP不打印当前的URL