$_SERVER[“SCRIPT_URI”] not working? alternative?

前端 未结 11 2535
北恋
北恋 2020-12-17 17:17

This is odd, but for some reason the $_SERVER[\"SCRIPT_URI\"] will not return the domain name when I am in child/sub-pages but will only work on the main page.

11条回答
  •  一向
    一向 (楼主)
    2020-12-17 17:52

    var_dump($_SERVER) and see what suites your needs.

    P.S. Making use of unsanitized $_SERVER["PHP_SELF"] could be a security risk.

提交回复
热议问题