Jump to content


Photo

gettin this Warning ....


  • Please log in to reply
5 replies to this topic

#1 dalmaca

dalmaca
  • Members
  • Pip
  • Newbie
  • 5 posts

Posted 12 March 2006 - 03:46 PM

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

Warning: gethostbyaddr(): Address is not a valid IPv4 or IPv6 address in /


any ideas ?


#2 hitman6003

hitman6003
  • Members
  • PipPipPip
  • Advanced Member
  • 1,807 posts

Posted 12 March 2006 - 03:59 PM

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.

#3 dalmaca

dalmaca
  • Members
  • Pip
  • Newbie
  • 5 posts

Posted 12 March 2006 - 08:27 PM

this is where it says the error is ....

$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]);


the error on that line just thought id better post that whole section as it might of been needed

#4 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 12 March 2006 - 08:32 PM

Give this a shot ... and/or print the remote_addr to see if you're getting something that makes sense.
$host=gethostbyaddr($_SERVER['REMOTE_ADDR']);

Legend has it that reading the manual never killed anyone.
My site

#5 dalmaca

dalmaca
  • Members
  • Pip
  • Newbie
  • 5 posts

Posted 12 March 2006 - 09:11 PM

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

#6 phporcaffeine

phporcaffeine
  • Members
  • PipPipPip
  • Advanced Member
  • 361 posts
  • LocationOhio, USA

Posted 12 March 2006 - 09:16 PM

[!--quoteo(post=354302:date=Mar 12 2006, 04:11 PM:name=dalmaca)--][div class=\'quotetop\']QUOTE(dalmaca @ Mar 12 2006, 04:11 PM) View Post[/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'] )
Thanks,

Ryan Huff
President & Founder, MyCodeTree
support@mycodetree.com | http://mycodetree.com




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users