well, $SERVER_NAME would contain
www.phpbuilder.com
if you are 100% sure its going to start with "www." and end in ".com" use this
$name = $SERVER_NAME;
$name = ereg_replace("www.", '', $name);
$name = ereg_replace(".com", '', $name);
there we are.
if you are not 100% sure of the www or com but are 100% sure that it will allways have two periods in it. ie
www.php.net
snaps.php.net
$name = $SERVER_NAME;
$name = explode('.', $name);
$name = $name[1];
both these methods will not work for either of.
sourceforge.net
www.spectrum.ieee.com
These two methods will also get the acuall SERVER_NAME from where the code came from, not nesissarly the URL. with javascript you can accually change what appears in the URL.
Chris Lee