Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2005
    Location
    Norway
    Posts
    391

    Getting base domain

    If I have a domain which would for example be domain.com, how would I retrieve that with PHP?

    If I were to upload a PHP script at my domain which would be domain.com, how would I get it to echo domain.com?

    Thanks!

  2. #2
    just set up a redirector thru your cpanel or sumtin

  3. #3
    Join Date
    Jun 2002
    Location
    Perth, Australia
    Posts
    85
    Originally posted by inVasionHosting
    just set up a redirector thru your cpanel or sumtin
    You might want to try reading the question properly next time!

    UrlGuy, Try this:
    PHP Code:
    <?php echo $_SERVER['HTTP_HOST']; ?>
    Cheers

  4. #4
    Join Date
    Feb 2005
    Location
    Norway
    Posts
    391
    Thanks jameso

  5. #5
    Join Date
    Jun 2002
    Location
    Perth, Australia
    Posts
    85
    No worries

Posting Permissions

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