PHP: how to get the url of the currently executing script?

Posted by powerboy on Stack Overflow See other posts from Stack Overflow or by powerboy
Published on 2010-05-25T05:33:15Z Indexed on 2010/05/25 6:11 UTC
Read the original article Hit count: 207

Filed under:

For example, the url http://www.domain.com/folder/script.php sends a request to /var/www/domain/folder/script.php. In script.php, I want to echo http://www.domain.com/folder/ (not /var/www/domain/folder/, not http://www.domain.com/folder/script.php). What is the simplest way to do this?

© Stack Overflow or respective owner

Related posts about php