PHP referer

Discussion in 'PHP' started by terryuk, Jun 18, 2007.

  1. #1
    terryuk, Jun 18, 2007 IP
  2. krakjoe

    krakjoe Well-Known Member

    Messages:
    1,795
    Likes Received:
    141
    Best Answers:
    0
    Trophy Points:
    135
    #2
    use parse_url

    
    <?
    $parsed = parse_url( 'http://krakjoe.com/no/pages/here.php' );
    echo $parsed['host'];
    ?>
    
    PHP:
     
    krakjoe, Jun 18, 2007 IP
    terryuk likes this.
  3. terryuk

    terryuk Notable Member

    Messages:
    3,962
    Likes Received:
    319
    Best Answers:
    0
    Trophy Points:
    255
    #3
    Thanks again Joe! :eek:
     
    terryuk, Jun 18, 2007 IP
  4. Lemezo

    Lemezo Active Member

    Messages:
    429
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    75
    #4
    You can also explode the url, and put a limit of 4, and 4 will be the text after the domain/

    You can use explode to get particular parts out of the url.
     
    Lemezo, Jun 18, 2007 IP