Thread: Ip address

    #1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Location
    kerala, India
    Posts
    81
    Rep Power
    2

    Ip address


    Hi,

    I have domain quinnstheprinters.ie. Iam redirect this domain to quinnstheprinters.com. How can i get the ip address of quinnstheprinters.ie and quinnstheprinters.com Please help

    Regards,
    Sarath_PHP
  2. #2
  3. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,959
    Rep Power
    1014
    Let me google that for you, dear friend:

    http://lmgtfy.com/?q=php+get+ip+domain
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Location
    kerala, India
    Posts
    81
    Rep Power
    2

    Ipaddress


    Hi friend,

    I checked in google, iam getting ip address of quinnstheprinters.com, but not getting ip address of quinnstheprinters.ie.

    I used command prompt, for checking ip address of domains.The result is 78.153.212.173 (quinnstheprinters.ie) and 174.123.213.184 (quinnstheprinters.com).

    The php code i used:

    1 : In the case of quinnstheprinters.com

    <?php
    $IPaddress = $_SERVER['SERVER_ADDR'];
    echo $IPaddress;
    ?>

    Result is : 174.123.213.184


    2 : In the case of quinnstheprinters.ie

    <?php
    $IPaddress = $_SERVER['SERVER_ADDR'];
    echo $IPaddress;
    ?>

    Result is : same as quinnstheprinters.com


    How can i get ip address of quinnstheprinters.ie?

    Regards
    Sarath_PHP
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Location
    kerala, India
    Posts
    81
    Rep Power
    2
    Hi Jacques1,

    I checked in google, iam getting ip address of quinnstheprinters.com, but not getting ip address of quinnstheprinters.ie.

    I used command prompt, for checking ip address of domains.The result is 78.153.212.173 (quinnstheprinters.ie) and 174.123.213.184 (quinnstheprinters.com).

    The php code i used:

    1 : In the case of quinnstheprinters.com

    <?php
    $IPaddress = $_SERVER['SERVER_ADDR'];
    echo $IPaddress;
    ?>

    Result is : 174.123.213.184


    2 : In the case of quinnstheprinters.ie

    <?php
    $IPaddress = $_SERVER['SERVER_ADDR'];
    echo $IPaddress;
    ?>

    Result is : same as quinnstheprinters.com


    How can i get ip address of quinnstheprinters.ie?

    Regards
    Sarath_PHP
  8. #5
  9. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,959
    Rep Power
    1014
    It's not possible -- at least there's no reliable way to do it with your current setup.

    What this "redirect" actually does is tell the user's browser that the page is now at a different location. The browser will then typically request the page at the new location. But there's no connection between the two request. There's no information about the original page (like the referrer).

    What you could do is append this information to the new URL:
    PHP Code:
    header('Location: http://quinnstheprinters.com?origin=ie'); 
    But I'm pretty sure that's not what you want.

    You'll need a more advanced technique like a proxy to keep the information about the original page. But I'm no expert on that topic.
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Location
    kerala, India
    Posts
    81
    Rep Power
    2
    hi Jacques1,


    Thanks for your reply.
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Location
    kerala, India
    Posts
    81
    Rep Power
    2
    Hi Jacques1,

    Actually i didn't get the result so i was add another post. So please let me know, do i need to host quinnstheprinters.ie as seperate website.
  14. #8
  15. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,959
    Rep Power
    1014
    I gave you two possibilities: Either you use a URL parameter to pass information about the original site, or you set up a proxy (and use the X-Forwarded-For header field to get the original IP).

    Which one you use is up to you. If you go with the proxy, I cannot help you, because I don't know how exactly that works. Read that up yourself and use the Apache forum if there's something you don't understand.
    The 6 worst sins of security ē How to (properly) access a MySQL database with PHP

    Why canít I use certain words like "drop" as part of my Security Question answers?
    There are certain words used by hackers to try to gain access to systems and manipulate data; therefore, the following words are restricted: "select," "delete," "update," "insert," "drop" and "null".
  16. #9
  17. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Location
    kerala, India
    Posts
    81
    Rep Power
    2
    Hi Jacques1,

    Thank u so much, i got it. I use URL parameter.

IMN logo majestic logo threadwatch logo seochat tools logo