SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member edpudol's Avatar
    Join Date
    Oct 2004
    Location
    philippines
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Convert IP to DNS or Host

    Hi,

    How could I convert IP address to DNS or Host...

    e.g. 216.7.168.16 - premierwebsitesolutions.com

    thanks for the help
    Visit us at lexorsoft.net , if you need SEO related services

  2. #2
    ********* Genius Mike's Avatar
    Join Date
    Apr 2001
    Location
    Canada
    Posts
    5,458
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    <?php
    $hostname 
    gethostbyaddr($_SERVER['REMOTE_ADDR']);
    ?>
    Mike
    It's not who I am underneath, but what I do that defines me.

  3. #3
    SitePoint Member edpudol's Avatar
    Join Date
    Oct 2004
    Location
    philippines
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi mike thanks for the quick repply.. and it works... I have follow up.. how about getting the title of the page my site visitor viewing..

    Thanks
    Visit us at lexorsoft.net , if you need SEO related services

  4. #4
    ********* Genius Mike's Avatar
    Join Date
    Apr 2001
    Location
    Canada
    Posts
    5,458
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    $_SERVER['PHP_SELF'] will give you the filename, but to get the actual title you'd need to use javascript.
    Mike
    It's not who I am underneath, but what I do that defines me.

  5. #5
    SitePoint Member edpudol's Avatar
    Join Date
    Oct 2004
    Location
    philippines
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Mike
    $_SERVER['PHP_SELF'] will give you the filename, but to get the actual title you'd need to use javascript.
    Can I past the javascript variable to php variable?
    Visit us at lexorsoft.net , if you need SEO related services

  6. #6
    ********* Genius Mike's Avatar
    Join Date
    Apr 2001
    Location
    Canada
    Posts
    5,458
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It would be so much easier if you just made a CMS so the page title would be in PHP to begin with

    No you can't, not without something like xmlHttpRequest. I guess you could use javascript to print a 1x1 gif though and pass the title through GET vars.
    Mike
    It's not who I am underneath, but what I do that defines me.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •