узнать домен при запросе с другого хоста!

Discussion in 'PHP' started by malik555, 9 Feb 2010.

  1. malik555

    malik555 New Member

    Joined:
    4 Feb 2009
    Messages:
    132
    Likes Received:
    1
    Reputations:
    0
    Собственно на одном хосте стоит скрипт

    <img src="http://site.ru/img.php" />


    хост http://site.ru/img.php отдает картинки , и мне нужно на нем определить домен откуда пришел запрос !

    Кок это реализовать ?
     
  2. Kaimi

    Kaimi Well-Known Member

    Joined:
    23 Aug 2007
    Messages:
    1,732
    Likes Received:
    811
    Reputations:
    231
    Глянуть заголовок Referer
     
    _________________________
  3. malik555

    malik555 New Member

    Joined:
    4 Feb 2009
    Messages:
    132
    Likes Received:
    1
    Reputations:
    0
    если не зетруднит можно премерчик ?
     
  4. nMonkn

    nMonkn Member

    Joined:
    4 Jan 2010
    Messages:
    16
    Likes Received:
    5
    Reputations:
    0
    $ref = $_SERVER['HTTP_REFERER'];
     
  5. suser

    suser Member

    Joined:
    30 Dec 2009
    Messages:
    35
    Likes Received:
    5
    Reputations:
    0
    или <? echo getenv("HTTP_REFERER"); ?>