dalmaca Posted March 12, 2006 Share Posted March 12, 2006 i am runnign a website witch is up and running fine... decided to make a new site running the same script but slight changes ( layout / theme ect)anyway i got another webserver ( the same as the real site is running, same host, same package ect )but on the new site when i upload the sctrip and goto sign up i get this error[code]Warning: gethostbyaddr(): Address is not a valid IPv4 or IPv6 address in / [/code]any ideas ? Link to comment https://forums.phpfreaks.com/topic/4755-gettin-this-warning/ Share on other sites More sharing options...
hitman6003 Posted March 12, 2006 Share Posted March 12, 2006 Apparently your not passing a valid IP address to your gethostbyaddr function.There's no way we can help you beyond that point without seeing the code for at least that function. Link to comment https://forums.phpfreaks.com/topic/4755-gettin-this-warning/#findComment-16687 Share on other sites More sharing options...
dalmaca Posted March 12, 2006 Author Share Posted March 12, 2006 this is where it says the error is ....[code]$host=gethostbyaddr("$REMOTE_ADDR"); <<<<<<<<<THIS LINE$getbans =mysql_query("SELECT banned FROM $tab[banned];");$bans = array();while($ban=mysql_fetch_array($getbans)) { array_push($bans, $ban[0]);[/code]the error on that line just thought id better post that whole section as it might of been needed Link to comment https://forums.phpfreaks.com/topic/4755-gettin-this-warning/#findComment-16769 Share on other sites More sharing options...
AndyB Posted March 12, 2006 Share Posted March 12, 2006 Give this a shot ... and/or print the remote_addr to see if you're getting something that makes sense.[code]$host=gethostbyaddr($_SERVER['REMOTE_ADDR']);[/code] Link to comment https://forums.phpfreaks.com/topic/4755-gettin-this-warning/#findComment-16772 Share on other sites More sharing options...
dalmaca Posted March 12, 2006 Author Share Posted March 12, 2006 well the warning gone now , but it doesnt seem to let me goto step 2 ps its a sign up page , buti think thats sumthing my end ( on server its self)Thnx Link to comment https://forums.phpfreaks.com/topic/4755-gettin-this-warning/#findComment-16787 Share on other sites More sharing options...
phporcaffeine Posted March 12, 2006 Share Posted March 12, 2006 [!--quoteo(post=354302:date=Mar 12 2006, 04:11 PM:name=dalmaca)--][div class=\'quotetop\']QUOTE(dalmaca @ Mar 12 2006, 04:11 PM) [snapback]354302[/snapback][/div][div class=\'quotemain\'][!--quotec--]well the warning gone now , but it doesnt seem to let me goto step 2 ps its a sign up page , buti think thats sumthing my end ( on server its self)Thnx[/quote]$REMOTE_ADDR is a depriciated variable aside from the fact that there are several directives in PHP.INI that can stop vars like this. I imagine that you do not have access to PHP.INI on this server so you could try to pass the register_globals directive with ini_set if the host allows.Your other option is to use the $_SERVER array as mentioned above. ( $_SERVER['REMOTE_ADDR'] ) Link to comment https://forums.phpfreaks.com/topic/4755-gettin-this-warning/#findComment-16788 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.