Getting variable from url

Discussion in 'PHP' started by BAM78, Feb 29, 2008.

  1. #1
    BAM78, Feb 29, 2008 IP
  2. Vbot

    Vbot Peon

    Messages:
    107
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Use:
    echo $_SERVER['QUERY_STRING'];
    PHP:
    to grab that part.
     
    Vbot, Feb 29, 2008 IP
  3. bartolay13

    bartolay13 Active Member

    Messages:
    735
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    98
    #3
    <?
    echo $_GET['a'];
    ?>
     
    bartolay13, Feb 29, 2008 IP
  4. BAM78

    BAM78 Peon

    Messages:
    115
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    thanks guys!
     
    BAM78, Feb 29, 2008 IP
  5. BAM78

    BAM78 Peon

    Messages:
    115
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    just curious how can I get this if it was a external url?
     
    BAM78, Feb 29, 2008 IP
  6. Vbot

    Vbot Peon

    Messages:
    107
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #6
    $external_url = "http://www.test.net/test.php?a=112/testing";
    echo substr(strrchr($external_url, '?'),1);
    PHP:
     
    Vbot, Feb 29, 2008 IP