please help with little php issue

Discussion in 'PHP' started by eshkolit, Aug 20, 2007.

  1. #1
    hi, i need to solve the following simple yet bothering problem:

    url of my page is like

    domain.com/?a=some_string&b=another_string


    how i can get some_string and another_string and print them on the page easily?


    thanks a lot!
     
    eshkolit, Aug 20, 2007 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    
    <?php
    
    echo $_GET['a']; // Will output "some_string"
    
    ?>
    
    PHP:
     
    nico_swd, Aug 20, 2007 IP
  3. tamilsoft

    tamilsoft Banned

    Messages:
    1,155
    Likes Received:
    78
    Best Answers:
    0
    Trophy Points:
    0
    #3
    foreach($_GET as $name=>$value)
    {
    echo "$name=$value<BR>";
    }
    PHP:
     
    tamilsoft, Aug 20, 2007 IP
  4. eshkolit

    eshkolit Well-Known Member

    Messages:
    849
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    108
    #4
    it works, thanks a lot!
     
    eshkolit, Aug 21, 2007 IP