Jump to content

Archived

This topic is now archived and is closed to further replies.

dalmaca

gettin this Warning ....

Recommended Posts

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 ?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
[!--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'] )

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.