doufeng1249
2014-08-29 03:30
浏览 108
已采纳

如何在PHP中获取当前目录的链接?

I have been trying to get the current directory link and come up with something like this as:

<?php echo "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]paypal_success.php"; ?>

but really that didn't work as I got the output as :

http://localhost/php-login-new/invoice.phppaypal_success.php

so really I want to trim the invoice.php from it so if you can guide me please how I can do that..it will be great..!

图片转代码服务由CSDN问答提供 功能建议

我一直试图获取当前目录链接并提出如下内容:</ p> \ n

 &lt;?php echo“http:// $ _ SERVER [HTTP_HOST] $ _SERVER [REQUEST_URI] paypal_success.php”;  ?&gt; 
 </ code> </ pre> 
 
 

但实际上这不起作用,因为我得到输出:</ p>

  http:  //localhost/php-login-new/invoice.phppaypal_success.php
nn

所以我真的想修剪invoice.php,所以如果你可以指导我的话 请问我该怎么做..这将是伟大的..!</ p> </ div>

2条回答 默认 最新

相关推荐 更多相似问题