PDA

View Full Version : Can anyone help with the Server protocol and port?


Boofo
03-06-2004, 01:31 AM
Can anyone please tell me why the following line doesn't work in the functions.php?

$servertype = '<br />Server Type: ' ."$serverinfo | Protocol: $SERVER_PROTOCOL | Port: $SERVER_PORT | IP: $SERVER_ADDR";

I got the serverinfo to come up but the rest of it doesn't show anything.

Also, in the following line, I got my IP address to show up but I can't get the port to show up. This worked fine in vB2. I had to change $REMOTE_ADDR to $_SERVER['REMOTE_ADDR'] to get it to work in vB3, though.


$ipaddress = ' <b>--</b> Your IP Address: ' . $_SERVER['REMOTE_ADDR'] . ' (port ' . $REMOTE_PORT . ')';

Natch
03-06-2004, 02:18 AM
You are better off working with the assumption that register_globals is OFF ... so use $_SERVER['VAR_NAME'] rather than $VAR_NAME (or the equivalent ... check out php.net under pre-defined variables ...

Boofo
03-06-2004, 02:20 AM
You are better off working with the assumption that register_globals is OFF ... so use $_SERVER['VAR_NAME'] rather than $VAR_NAME (or the equivalent ... check out php.net under pre-defined variables ...
I tried that already. And php.net didn't have anything on most of them. At least, I couldn't find them. ;)

Boofo
03-06-2004, 02:25 AM
You are better off working with the assumption that register_globals is OFF ... so use $_SERVER['VAR_NAME'] rather than $VAR_NAME (or the equivalent ... check out php.net under pre-defined variables ...
Natch, it worked. I was using the wrong variables. Thank you for setting me straight on this. I owe you one, my friend. ;)

Natch
03-06-2004, 02:33 AM
:) php.net has it all ... sometimes it's just hard to find ;)

Glad to be of service :D