Anything that detects the domain and can impant it into the site?

Discussion in 'Programming' started by simon369, Nov 4, 2007.

  1. #1
    is there any code that could be added to a page which would when loaded detect what domain its on then implant it where i put the code

    E.g. i run proxy sites and everytime i have to change the title when i upload but it would be a great little code if i just uploaded all the files and when the page loads it detects what domain its on and enters that

    so it would have welcome to <code> but when it loads it would come out as welcome to domain.com
     
    simon369, Nov 4, 2007 IP
  2. frankcow

    frankcow Well-Known Member

    Messages:
    4,859
    Likes Received:
    265
    Best Answers:
    0
    Trophy Points:
    180
    #2
    here you go:
    <?php echo($_SERVER['HTTP_HOST']); ?> 
    PHP:
     
    frankcow, Nov 4, 2007 IP
    simon369 likes this.
  3. simon369

    simon369 Active Member

    Messages:
    1,712
    Likes Received:
    47
    Best Answers:
    0
    Trophy Points:
    90
    #3
    Thaks

    repp +++
     
    simon369, Nov 4, 2007 IP
  4. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #4
    really shouldnt do it as inline code as you are then no better than PHP :p but the inline code version for .Net would simply be

    
    <%=Request.Url.Host.ToString  %> 
    
    Code (.Net):
     
    AstarothSolutions, Nov 5, 2007 IP