I don't know whats wrong, but once I moved my scripts from php version 4.4.2 to 5.1.2, this part of my coding seems to be having issues... Could someone take a look at it and tell me whats wrong? Whenever it prints the $line, it doesn't print the ip address...
The reason why it's being checked is for low server configuration that does not allow 'all usage' of $_SERVER variable (due to some restrictions that might be added). In this case, it will call the getenv function in case it fails.
I'm curious - what's "low server configuration" and what's "all usage of $_SERVER variable" or are you just making stuff up because of lack of knowledge? Just stop giving away wrong advices and posting unnecessary code..if you can't learn adequate programming practices, don't enforce other people to use them. Thank you for understanding.
Well, if you're going all out, don't forget to check $_SERVER['HTTP_X_FORWARDED_FOR']
Jacob - WebOnce Technologies - 30 Day 100% Satisfaction Guarantee - Over 5 Years Going Strong! Website Hosting, PHP4&5, RoR, MySQL 5.0, Reseller Hosting, Development, and Designs
horizon, don't want to put your code down, if his configuration doesn't allow/assign variables to the $_SERVER configuration: thats another problem. Why even bother getting it to check (using valuable load time) when its almost always going to exist.