Ravens PHP Scripts

Fix for Warning:Address is not a valid IPv4 or IPv6 address
Date: Thursday, December 26, 2002 @ 08:13:57 CST
Topic: Guest Book


With the release of KISGB v4.2.0, I added a function to translate the visitor's IP address to a host name, as some have requested. However, some sites, when using a proxy, will mask the IP, which causes the gethostbyaddr() function to return a value that php flags as an invalid IP format. If you have error_reporting set to E__ERROR or display_errors = Off, then the message is suppressed to the log and is not an issue. To circumvent the 'Warning' that PHP throws, please read on.

Here is a quick 'work-around' if you do not have access to your php.ini file: In functions.php, on line 30, is this line: $hosti = gethostbyaddr($czysty); Modify it to read: $hosti = @gethostbyaddr($czysty); That will/should suppress all errors for that function call.





This article comes from Ravens PHP Scripts
https://www.ravenphpscripts.com

The URL for this story is:
https://www.ravenphpscripts.com/modules.php?name=News&file=article&sid=62