fetching one query from address bar

Discussion in 'PHP' started by khan11, Nov 24, 2007.

  1. #1
    Hello guys,


    sorry to disturb u again.

    in my old topic i asked about fetching query strings. so nico helped me by telling $_SERVER['QUERY_STRING'] command.

    This command is useful but the problem is, it fetches every query from top..

    I want to fetch only query of my choice like:
    if i have page.php?show=00&from=00

    I only want to fetch show=00 or from=00

    if it is possible? then how i can do?

    as usual quick help will be appreciated.

    Thank you!
     
    khan11, Nov 24, 2007 IP
  2. serialCoder

    serialCoder Guest

    Best Answers:
    0
    #2
    yep, its actually easy you access them through $_GET vars

    ex:

    $_GET['show'] or $_GET['from']
     
    serialCoder, Nov 24, 2007 IP
    khan11 likes this.
  3. udkl_12_98

    udkl_12_98 Banned

    Messages:
    307
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I assume you know of the $_GET and $_POST methods....


    page.php?show=00&from=00
    Suppose you get the server_query in $url

    $arr1 = explode("&",$url);

    $show = explode("=",$arr1[0]);
    $show = $show[1];

    $from = explode("=",$arr1[1]);
    $from = $from[1];
     
    udkl_12_98, Nov 24, 2007 IP
  4. khan11

    khan11 Active Member

    Messages:
    615
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    58
    #4
    lol..

    i just realised after posting this topic.. that i can do through this way.

    anyways thank you all for your help. thank you udkl_12_98 for your formulas but i'm a newbie in php so can't understand this.
     
    khan11, Nov 24, 2007 IP