On 21 May 2011 17:18, Stuart Dallas <stuart@xxxxxxxx> wrote: *snip* >> Again, this depends upon what your url scheme looks like - and without >> knowing that, there's simple no clue as to whether or not this is a >> good solution to the problem (though it might be a good solution to A >> problem). > > Again, I disagree. If you have an example of a URL structure where this > would not work I'd love to hear it. > -Stuart Having to replace several times just in order to figure out the path to your script is pointless if you know the name of the script (which you always do - it's __FILE__ ) and you're using a one-to-one request-to-script scheme. Then just grab the part of the url up to and including your scriptname. Note I used the word good - doing several str_replace() and other calls is not what I consider a good solution if there's something simpler available with as good a result. Regards Peter -- <hype> WWW: plphp.dk / plind.dk LinkedIn: plind BeWelcome/Couchsurfing: Fake51 Twitter: kafe15 </hype> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php