怎样获得当前页面的完整url? $fileurl=$DOCUMENT_ROOT.$filename;allright 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 $url = 'http://'.getenv('HTTP_HOST').getenv('REQUEST_URI'); 如果你能仔细看看 phpinfo() 的话就不用花这 10 分了 $_SERVER["REQUEST_URI"] 这个是 4.1 以后才能用的…… 没试过3.几版本的php,应该也行,因为这是环境变量,不过估计不能用$_SERVER['...'],应该用getenv(). 来看看chinaren是怎么用JS实现的吧function UrlConv(url){ if(url.href.indexOf("backdoor.jsp")>0) url="http://www.chinaren.com"; url = url + ""; var m_url = url; var outstring = ""; var x1 = 0; for(x1 = 0 ; x1 < (m_url.length) ; x1++) { chr = m_url.substr(x1,1); if(chr=='&') { outstring += "%26"; continue; } if(chr=='?') { outstring += "%3F"; continue; } if(chr==':') { outstring += "%3A"; continue; } outstring += chr; } return outstring;}function login(){ top.document.location = "http://profile.chinaren.com/zhs/login.jsp?group=alumni&url="+UrlConv(top.window.location);}function logout(){ top.document.location = "http://profile.chinaren.com/zhs/backdoor.jsp?group=alumni&url="+UrlConv(top.window.location);}function register(){ top.document.location = "http://profile.chinaren.com/zhs/register.jsp?group=alumni&url="+UrlConv(top.window.location);} similar_text算相似性时归一化时的疑问 php按条件读取txt广本内容 如何开发一个简单的个人网站 问下这样写安全吗 php事务 执行sql语句 PHP连接数据库问题。比较奇怪 数据打印不显示????? 怎么在windows .net server2003中安装PHP呢? PHP web程序开发如何设计 网站里面文件夹或者文件如何用php程序批量锁定防删除防修改 为什么在浏览器中无法正常显示中文? 如何多次使用header函数?
如果你能仔细看看 phpinfo() 的话就不用花这 10 分了 $_SERVER["REQUEST_URI"] 这个是 4.1 以后才能用的……
{
if(url.href.indexOf("backdoor.jsp")>0)
url="http://www.chinaren.com";
url = url + "";
var m_url = url;
var outstring = "";
var x1 = 0;
for(x1 = 0 ; x1 < (m_url.length) ; x1++)
{
chr = m_url.substr(x1,1);
if(chr=='&')
{
outstring += "%26";
continue;
}
if(chr=='?')
{
outstring += "%3F";
continue;
}
if(chr==':')
{
outstring += "%3A";
continue;
}
outstring += chr;
}
return outstring;
}
function login(){
top.document.location = "http://profile.chinaren.com/zhs/login.jsp?group=alumni&url="+UrlConv(top.window.location);
}function logout(){
top.document.location = "http://profile.chinaren.com/zhs/backdoor.jsp?group=alumni&url="+UrlConv(top.window.location);
}function register(){
top.document.location = "http://profile.chinaren.com/zhs/register.jsp?group=alumni&url="+UrlConv(top.window.location);}