bshirley wrote in php

subdomains & PHP_SELF

I have a php script that is referencing itself

printf("click here", $PHP_SELF);

it is normally at

www.domain.com/foo/self.php

but I also have a subdomain (which I would prefer to access it through) which looks like

foo.domain.com/self.php

when I access the php via the second URL, the PHP_SELF variable still says foo/self.php, so it tries to open foo.domain.com/foo/self.php, which does not exist,

¿Is there any way to resolve this?
¿Is there a preferred way to solve this?

tia,
-bill