SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Wizard
    Join Date
    Apr 2002
    Posts
    2,322
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    why would someone do this in their form?

    this is part of someone elses form from a server, that i'm trying to pick apart:

    <INPUT TYPE="hidden" NAME=".cgifields" VALUE="method">
    <INPUT TYPE="hidden" NAME=".cgifields" VALUE="nonblocking">

    isn't the first line completely reduntant? the name ".cgifields" will end up equalling "nonblocking". nothing more and nothing less, surely? they could have omitted the first line, or am I missing something?
    Last edited by johnyboy; May 3, 2002 at 08:34.

  2. #2
    pg for mild peril cow's Avatar
    Join Date
    Mar 2000
    Location
    nevada, usa
    Posts
    636
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yeah, that person probably meant to assign those two values to different variables.
    "There's no justice like angry mob justice!" --Seymour Skinner

  3. #3
    Grumpy Mole Man Skunk's Avatar
    Join Date
    Jan 2001
    Location
    Lawrence, Kansas
    Posts
    2,066
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Actually I'm pretty sure you can assign two values to the same field. The data sent to the server will end up looking like this:

    .cgifields=method&.cgifields=nonblocking

    Depending on how the CGI program parses the input from the form it could use both values (possibly by sticking them in an array). Many perl programs handle parsing of the query string / post data themselves so it would not be hard to write a perl program that could do something useful with the information from that form.

  4. #4
    SitePoint Wizard
    Join Date
    Apr 2002
    Posts
    2,322
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    right. this is a cgi not an html question isn't it? i'll post it on there. thanks v.much

  5. #5
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I wouldn't of thought

    .cgifields

    was a good form name anyway?

  6. #6
    SitePoint Wizard
    Join Date
    Apr 2002
    Posts
    2,322
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    i have no idea andrew - but it's not my script so it's not in my hands
    why would it be a bad name?

  7. #7
    Making a better wheel silver trophy DR_LaRRY_PEpPeR's Avatar
    Join Date
    Jul 2001
    Location
    Missouri
    Posts
    3,428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i guess he means because it has a period in it.
    - Matt ** Ignore old signature for now... **
    Dr.BB - Highly optimized to be 2-3x faster than the "Big 3."
    "Do not enclose numeric values in quotes -- that is very non-standard and will only work on MySQL." - MattR

  8. #8
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yes, i've never named a form like that, but wouldn't this make it difficult to add javascript to the object

  9. #9
    SitePoint Wizard Ian Glass's Avatar
    Join Date
    Oct 2001
    Location
    Beyond yonder
    Posts
    2,384
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah.

    Also, don't IDs have to start with a letter or number? I don't even think they can have "." in them at all. That is, of course if I can remember correctly -- it's 4:30 a.m. here. :-p

    ~~Ian

  10. #10
    SitePoint Zealot
    Join Date
    Feb 2002
    Location
    UK
    Posts
    146
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    just for info, from w3c: html 4.01 spec: cdata
    ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".").
    from what i've read it looks like this code is generated by CGI.pm, a perl library used to create html forms on the fly.

    interestingly, the author also uses '.' to precede his 'submit' field name, but not in other input fields.

    maybe someone in the perl forum knows more about it (if you're curious).

    hope this is useful
    Last edited by martm; May 5, 2002 at 07:06.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •