cgi problem with "gt" and "lt"

Discussion in 'Perl Misc' started by Nick Wedd, Jan 14, 2007.

  1. Nick Wedd

    Nick Wedd Guest

    Here is the piece of my code that causes a problem:

    foreach $cc ( param() ) {
    $col = param($cc);

    and here is a piece of my cgi argument list:

    gl=6&gt=6&hn=6&mx=6&ni=8

    It all works except for when $cc (the key) is "gt" or "lt". I can guess
    what is going on, but I have no idea what I should do about it. Can
    someone please advise?

    Nick
    --
    Nick Wedd
     
    Nick Wedd, Jan 14, 2007
    #1
    1. Advertisements

  2. Nick Wedd

    Paul Lalli Guest

    Nick Wedd wrote:
    > Here is the piece of my code that causes a problem:


    *What* problem?

    > foreach $cc ( param() ) {
    > $col = param($cc);
    >
    > and here is a piece of my cgi argument list:
    >
    > gl=6&gt=6&hn=6&mx=6&ni=8
    >
    > It all works


    "works" *how*?

    > except for when $cc (the key) is "gt" or "lt". I can guess
    > what is going on, but I have no idea what I should do about it.


    Should do about *what*?

    > Can someone please advise?


    Advise about *what*?!

    No where in this post have you told us either what you're *trying* to
    do, nor how what you're actually doing is failing! How is anyone
    supposed to help you fix your problem, when you haven't told anyone
    what the problem is nor even what the goal is?!

    Please read the Posting Guidelines for this group. Seriously. Right
    now. They are posted here twice a week. A simple search will reveal
    them. Please do not reply until you read them.

    Paul Lalli
     
    Paul Lalli, Jan 14, 2007
    #2
    1. Advertisements

  3. Nick Wedd <> wrote:

    > Here is the piece of my code that causes a problem:
    >
    > foreach $cc ( param() ) {
    > $col = param($cc);



    What problem does it cause you?


    > and here is a piece of my cgi argument list:
    >
    > gl=6&gt=6&hn=6&mx=6&ni=8
    >
    > It all works



    What does "works" mean when you say it?

    That is, what did you intend it to do?


    > except for when $cc (the key) is "gt" or "lt". I can guess
    > what is going on, but I have no idea what I should do about it. Can
    > someone please advise?



    I advise that you tell us what you wanted it to do, and what it
    is doing that is different from what you wanted it to do.

    WAG:
    I sure hope you don't have an "eval EXPR" in your code that you
    haven't shown us...


    --
    Tad McClellan SGML consulting
    Perl programming
    Fort Worth, Texas
     
    Tad McClellan, Jan 15, 2007
    #3
  4. Nick Wedd

    Joe Smith Guest

    Nick Wedd wrote:
    > Here is the piece of my code that causes a problem:
    >
    > foreach $cc ( param() ) {
    > $col = param($cc);
    >
    > and here is a piece of my cgi argument list:
    >
    > gl=6&gt=6&hn=6&mx=6&ni=8
    >
    > It all works except for when $cc (the key) is "gt" or "lt".


    Try using ";" instead of "&" in the CGI argument list.

    gl=6;gt=6;hn=6;mx=6;ni=8

    http://www.w3.org/TR/html401/appendix/notes.html#ampersands-in-uris
     
    Joe Smith, Jan 15, 2007
    #4
  5. Nick Wedd

    Nick Wedd Guest

    In message <>, Joe Smith
    <> writes
    >Nick Wedd wrote:
    >> Here is the piece of my code that causes a problem:
    >> foreach $cc ( param() ) {
    >> $col = param($cc);
    >> and here is a piece of my cgi argument list:
    >> gl=6&gt=6&hn=6&mx=6&ni=8
    >> It all works except for when $cc (the key) is "gt" or "lt".

    >
    >Try using ";" instead of "&" in the CGI argument list.
    >
    > gl=6;gt=6;hn=6;mx=6;ni=8
    >
    >http://www.w3.org/TR/html401/appendix/notes.html#ampersands-in-uris


    Many thanks - yes - this was my problem.

    Nick
    --
    Nick Wedd
     
    Nick Wedd, Jan 15, 2007
    #5
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Shailan
    Replies:
    2
    Views:
    1,455
    Shailan
    Dec 15, 2003
  2. John Smith
    Replies:
    0
    Views:
    3,440
    John Smith
    May 15, 2006
  3. LarsenMTL
    Replies:
    4
    Views:
    1,132
    Eric Walstad
    Nov 4, 2004
  4. praba kar

    Python-cgi or Perl-cgi script doubt

    praba kar, Jul 30, 2005, in forum: Python
    Replies:
    1
    Views:
    1,128
    Michael Sparks
    Jul 30, 2005
  5. Amir  Michail

    cgi relay for python cgi script

    Amir Michail, Oct 4, 2005, in forum: Python
    Replies:
    7
    Views:
    785
    Michael Ekstrand
    Oct 4, 2005
  6. Luigi Ma
    Replies:
    0
    Views:
    302
    Luigi Ma
    Nov 21, 2007
  7. zippy

    cgi and cgi-bin

    zippy, Feb 1, 2005, in forum: Perl Misc
    Replies:
    5
    Views:
    759
    Sam Holden
    Feb 2, 2005
  8. BestFriend
    Replies:
    2
    Views:
    1,153
Loading...