duanhuo0577 2010-12-18 22:45
浏览 44

在php IN INCLUDE FILE中获取URL

i have some problem i try to get the uri in php.

I'm using:

 $_SERVER['REQUEST_URI']

It works just fine if i do it in the index.php, but, i NEED to get the url in a include file, but, when i do it, it takes the FILE adress, i mean, it shows something like this

adress bar: www.webpage.com/index.php

$_SERVER['REQUEST_URI'] output: webpage/includefile.php

I am explaining myself here? Thanks!

  • 写回答

3条回答 默认 最新

  • dsijovl015728613 2010-12-18 22:48
    关注

    How are you including the file? If it's being included via an HTTP reference then it's actually being served as a page and the functionality you are seeing is correct. If the include path is a local file, you shouldn't be seeing this behaviour

    评论

报告相同问题?

悬赏问题

  • ¥15 vue3+element-plus页面崩溃
  • ¥15 像这种代码要怎么跑起来?
  • ¥15 怎么改成循环输入删除(语言-c语言)
  • ¥15 安卓C读取/dev/fastpipe屏幕像素数据
  • ¥15 pyqt5tools安装失败
  • ¥15 mmdetection
  • ¥15 nginx代理报502的错误
  • ¥100 当AWR1843发送完设置的固定帧后,如何使其再发送第一次的帧
  • ¥15 图示五个参数的模型校正是用什么方法做出来的。如何建立其他模型
  • ¥100 描述一下元器件的基本功能,pcba板的基本原理