something like __URL__ (analogous to __FILE__)

From: Date: Wed, 24 Mar 2004 00:50:57 +0000
Subject: something like __URL__ (analogous to __FILE__)
Groups: php.general 
Request: Send a blank email to php-general+get-181338@lists.php.net to get a copy of this message
This is tricky to explain, so bear with me please. I have a file like: c:\htdocs\project_bunny\includes\config.php In my browser address bar, this would look like: http://localhost/project_bunny/includes/config.php If within this document (i.e. config.php), I had: <?php //config.php define("CONFIG_FILE", __FILE__); echo CONFIG_FILE; //this will return "c:\htdocs\project_bunny\includes\config.php" ?> Now, if I have another file (e.g. rabbits.php): <?php //rabbits.php include("config.php"); echo CONFIG_FILE; //this will also return "c:\htdocs\project_bunny\includes\config.php" ?> This is all great up to this point. What I'm trying to do is: <?php //config.php define("CONFIG_FILE_URL", __URL__); echo CONFIG_FILE_URL; //would return "http://localhost/project_bunny/includes/config.php" ?> So no matter what file I use (like rabbits.php) and I include config.php, CONFIG_FILE_URL will always return the url for the config file and NOT the file doing the calling (rabbits.php). Sorry for the longwinded explanation. I hope someone can help! Thank you. -m

« previous php.general (#181338) next »