Jump to content


Photo

Getting ip


  • Please log in to reply
3 replies to this topic

#1 ben1989

ben1989
  • New Members
  • Pip
  • Newbie
  • 7 posts

Posted 20 June 2006 - 07:41 PM

sorry to post this but the search wont work with IP its under 3 caricters :(

what is the $_GET to get the ip?


thanks

ben :)

#2 obsidian

obsidian
  • Staff Alumni
  • Advanced Member
  • 3,202 posts
  • LocationSeattle, WA

Posted 20 June 2006 - 07:44 PM

[!--quoteo(post=386129:date=Jun 20 2006, 03:41 PM:name=ben_stringer)--][div class=\'quotetop\']QUOTE(ben_stringer @ Jun 20 2006, 03:41 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
sorry to post this but the search wont work with IP its under 3 caricters :(

what is the $_GET to get the ip?
thanks

ben :)
[/quote]

there isn't a $_GET for it, but you can use $_SERVER:
echo $_SERVER['REMOTE_ADDR'];

You can't win, you can't lose, you can't break even... you can't even get out of the game.

<?php
while (count($life->getQuestions()) > 0)
{   $life->study(); } ?>
  LINKS: PHP: Manual MySQL: Manual PostgreSQL: Manual (X)HTML: Validate It! CSS: A List Apart | IE bug fixes | Zen Garden | Validate It! JavaScript: Reference Cards RegEx: Everything RegEx

#3 ben1989

ben1989
  • New Members
  • Pip
  • Newbie
  • 7 posts

Posted 20 June 2006 - 07:56 PM

Thanks

also what is it for to say mu hostname eg range23 @btibnbeg .con if u know what i mean :)

#4 ben1989

ben1989
  • New Members
  • Pip
  • Newbie
  • 7 posts

Posted 20 June 2006 - 08:33 PM

<?php
$hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']);

echo $hostname;
?>


done it :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users