Changes between some lines

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • The87Boy

    #1

    Changes between some lines

    I have some files with urls and the only change between the urls is
    the id, which stands as an argument but how can I see the id it in the
    easist way?
  • The87Boy

    #2
    Re: Changes between some lines

    On Dec 25, 8:09 pm, The87Boy <the87...@gmail .comwrote:
    I have some files with urls and the only change between the urls is
    the id, which stands as an argument
    As an argument in the url, as you e.g. can see on this url:

    but how can I see the id it in the easist way?

    Comment

    • Rik Wasmus

      #3
      Re: Changes between some lines

      On Tue, 25 Dec 2007 20:21:38 +0100, The87Boy <the87boy@gmail .comwrote:
      On Dec 25, 8:09 pm, The87Boy <the87...@gmail .comwrote:
      >I have some files with urls and the only change between the urls is
      >the id, which stands as an argument
      >
      As an argument in the url, as you e.g. can see on this url:

      >
      >but how can I see the id it in the easist way?
      In the request itself:
      $_GET['id']

      Parsing the url as a string in another file (if you'd like to examine the
      target in another script for instance):
      $id = false;
      $url = 'http://localhost/index.php?cmd=1 4&id=3325253&fr om=2';
      $querystring = parse_url($url, PHP_URL_QUERY);
      if(!empty($quer ystring)){
      parse_str($quer ystring,$array) ;
      $id = isset($array['id']) ? $array['id'] : false;
      }
      --
      Rik Wasmus

      Comment

      • The87Boy

        #4
        Re: Changes between some lines

        On Dec 27, 6:06 pm, "Rik Wasmus" <luiheidsgoe... @hotmail.comwro te:
        In the request itself:
        $_GET['id']
        I already know this one, but it is possible, it is not localhost, and
        there why I can not use this one
        Parsing the url as a string in another file (if you'd like to examine the
        target in another script for instance):
        $id = false;
        $url = 'http://localhost/index.php?cmd=1 4&id=3325253&fr om=2';
        $querystring = parse_url($url, PHP_URL_QUERY);
        if(!empty($quer ystring)){
        parse_str($quer ystring,$array) ;
        $id = isset($array['id']) ? $array['id'] : false;}
        This was actually what I was searching for, but I did not know, there
        was a PHP function, there why my question

        Comment

        Working...