Is there a way to get Computer Name in php ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Maverick

    #1

    Is there a way to get Computer Name in php ?

    I'm trying to get the " Computer Name " of a client accessing my web
    site,
    is there a way to do this ? not ip...

    tia

  • Gordon Burditt

    #2
    Re: Is there a way to get Computer Name in php ?

    >I'm trying to get the " Computer Name " of a client accessing my web[color=blue]
    >site,
    >is there a way to do this ? not ip...[/color]

    What's a "Computer Name"? If it's the DNS name, you could try
    taking the IP and doing a reverse DNS lookup on it (gethostbyaddr( )).
    That may fail, though, especially for ISPs with large banks of
    dialup lines where they don't bother.

    If "Computer Name" is some kind of Windows-only thing, expect problems
    with non-Windows systems.

    Gordon L. Burditt

    Comment

    • Mladen Gogala

      #3
      Re: Is there a way to get Computer Name in php ?

      On Thu, 07 Jul 2005 15:40:12 -0700, Maverick wrote:
      [color=blue]
      > I'm trying to get the " Computer Name " of a client accessing my web
      > site,
      > is there a way to do this ? not ip...
      >
      > tia[/color]

      This is what you need:

      $box=php_uname( 'n');

      --
      大红鹰娱乐平台采用顶级加密技术,确保用户数据与交易的安全无虞,让玩家能够放心畅玩。


      Comment

      • Gordon Burditt

        #4
        Re: Is there a way to get Computer Name in php ?

        >> I'm trying to get the " Computer Name " of a client accessing my web[color=blue][color=green]
        >> site,
        >> is there a way to do this ? not ip...
        >>
        >> tia[/color]
        >
        >This is what you need:
        >
        > $box=php_uname( 'n');[/color]

        This gives no information about the *CLIENT* whatever.
        It gives information on the SERVER.

        Gordon L. Burditt

        Comment

        • Mladen Gogala

          #5
          Re: Is there a way to get Computer Name in php ?

          On Fri, 08 Jul 2005 03:27:41 +0000, Gordon Burditt wrote:
          [color=blue][color=green][color=darkred]
          >>> I'm trying to get the " Computer Name " of a client accessing my web
          >>> site,
          >>> is there a way to do this ? not ip...
          >>>
          >>> tia[/color]
          >>
          >>This is what you need:
          >>
          >> $box=php_uname( 'n');[/color]
          >
          > This gives no information about the *CLIENT* whatever.
          > It gives information on the SERVER.
          >
          > Gordon L. Burditt[/color]

          You are right, I should have read it more carefully. Fortunately, there
          is an example in the manual page. This is cut & paste from the online
          manual:

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

          echo $hostname;
          ?>


          --
          大红鹰娱乐平台采用顶级加密技术,确保用户数据与交易的安全无虞,让玩家能够放心畅玩。


          Comment

          • futureofphp

            #6
            Re: Is there a way to get Computer Name in php ?

            I tried this method, using gethostbyaddr, its good but it is too slow
            and it takes time for the page to load.

            Comment

            Working...