I need to get the complete URL for what ever page I'm on and cant figure out how, i know how to get the basename and dir, but not the complete URL
example: http://www.phpbuilder.com/whatever/something/images/somepage.php
thanks.
Hi there! Have you used, server and environment variables. Try to use them. They best way is to <?=phpinfo();?> in a file and then see which variables return what. Join all these variables to find out on which page you are. An example of phpinfo page is here.
http://www.sulata.com.pk/htaccess/info
Tell me if this does not solve your problem.
Regards T. A. Barry
Get FREE domain with every hosting. So many features just for $79.99 per yr. www.BestPriceHost.com
The only variable I've used are PHP_SELF
in which i've used with some functions. However I still dont know how to get the, name.
basename($PHP_SELF); dirname($PHP_SELF);
I'm still rather new at php
Try this:
<? $URL = "http://whatever.com"; if ($QUERY_STRING =="") { $QUERY_STRING = "$QUERY_STRING"; } else { $QUERY_STRING = "?$QUERY_STRING"; } echo "$URL$PHP_SELF$QUERY_STRING"; ?>