Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Apr 2014
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How do i get a domain without HTTP:// using $_SERVER['HTTP_REFERER']

    Hello Everyone,

    I am using this script in my page which captures the redirecting domain into a text box,

    xyz.com redirects to abc.com/index.php

    <?php

    $server=$_SERVER['HTTP_REFERER'];

    echo $server;

    ?>


    This script enters HTTP://XYZ.COM in the text box, but i want XYZ.COM

    HTTP_HOST enters abc.com, and not xyz.com,


    how do i get xyz.com in the textbox


    thanks

  2. #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,996
    Thanks
    164
    Thanked 2,242 Times in 2,229 Posts
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  3. #3
    Senior Coder Dormilich's Avatar
    Join Date
    Jan 2010
    Location
    Behind the Wall
    Posts
    4,570
    Thanks
    14
    Thanked 479 Times in 474 Posts
    The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
    André Behrens, NY Times Software Developer


 

Posting Permissions

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