in reply to Meaning of part of a URL

If there was also also a ? somewhere in the URL, before the ch=752253556758 bit (so the URL looks like http://www.name of website.com/?&ch=752253556758), it is just a GET parameter being passed to the server. As such it has nothing to do with Perl or any other programming language.

Read all about GET in the HTTP 1.1 standard (p. 53) or the CGI standard.

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

)

Replies are listed 'Best First'.
Re^2: Meaning of part of a URL
by tachyon-II (Chaplain) on Jun 24, 2008 at 09:51 UTC

    You don't actually need the ? as "extra" data will be passed in the PATH_INFO environment var and can be retrieved and used by a CGI quite easily from there. ?& is something of a contradiction in terms although I guess most CGI parsing libs would deal with it and discard the first nameless, valueless param.

      You are right, but strictly speaking it is then not a parameter of the GET call and your server must "know" that some of the info is in the path and not in the parameter list.

      Try to drop the '?' in the above perlmonks URL and see what I mean.

      I wonder, is '&' even allowed as part of a path?

      CountZero

      A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James