SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Oct 2006
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Need help getting the complete url - is there a $_SERVER variable that will work?

    I'm currently working on a domain holding page that will automatically be placed on all new domains that i register (see www.colnedigital.com for the work in progress).

    Now, becuase there's the option to do so in my reseller account, this page will be applied to every new domain that I register. However, this option is of little use to me if then have to go and edit the code to change the domain name.

    I'm sure I've seen a very easy method to grab the whole url from the address bar before, but can't quite remember where i saw it or how to do it. Can anybody help me please?!

  2. #2
    SitePoint Enthusiast
    Join Date
    Dec 2006
    Posts
    48
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    is it $_SERVER['document root']
    ?
    newbie...really need your guidance......

  3. #3
    SitePoint Wizard bronze trophy Kailash Badu's Avatar
    Join Date
    Nov 2005
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <?php
    print $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] ;
    ?>

  4. #4
    SitePoint Member
    Join Date
    Oct 2006
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Kailash - thanks very much indeed - it works a treat! only need the $_SERVER['HTTP_HOST'] bit.

    Thanks!


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
  •