I need to create an anchor that will navigate to a different port on the server. For example, our server is located on domain.com:555 , we need a link to go to domain.com:777 . The trick is that it is not always domain.com. We can expect DNS to work, in which case we will use the ip address for navigation, like xx.xx.xx.xx:555 and xx.xx.xx.xx:777 .
I need to get the hostname of the server that the PHP script is running on. I tried using SERVER_ADDR, but for this reason I was given a private IP address of the server.
So how do I get the domain / ip part of the url?
source share