CGI.PM and print table

Discussion in 'Perl Misc' started by dtshedd@yahoo.com, Apr 13, 2008.

  1. Guest

    trying to replace this

    print "<table>\n";
    print "<tr><td><input type=\"submit\"></td><td><input type=\"reset\"></
    td></tr>\n";
    print "</table>\n";

    with this

    print table(
    TR([
    td([submit(),reset()])
    ])
    );

    seems to work but then a new name/value pair for "submit" shows up in
    the browser address bar

    original query string

    http://192.168.1.1/rocket.pl?page=1&keywords_string=3

    new query string

    http://192.168.1.1/rocket.pl?page=1&keywords_string=3&.submit=Submit Query

    what does this mean?

    appreciate the help

    dts
     
    , Apr 13, 2008
    #1
    1. Advertising

  2. wrote in
    news:4f43ff50-5243-4389-9d1a-b93372017ec9
    @m36g2000hse.googlegroups.co
    m:

    > trying to replace this
    >
    > print "<table>\n";
    > print "<tr><td><input type=\"submit\"></td><td><input
    > type=\"reset\"></ td></tr>\n";
    > print "</table>\n";
    >
    > with this
    >
    > print table(
    > TR([
    > td([submit(),reset()])
    >])
    > );
    >
    > seems to work but then a new name/value pair for "submit" shows up
    > in the browser address bar


    It seems to me that there are gaps in your knowledge of HTML and CGI
    and you might want to learn more about those topics before going any
    further.

    The HTML code you show above does not specify names for the input
    elements. On the other hand, CGI.pm does specify names for the input
    elements. Therefore, when the CGI.pm generated HTML code is used,
    form submission causes the name-value pair for the submit button
    that was used to be submitted along with the rest of the data.

    There is a good reason for this. For example:

    <input type="submit" name="action" value="Copy">
    <input type="submit" name="action" value="Move">
    <input type="submit" name="action" value="Delete">

    Then, your script can take actions based on the value of the action
    parameter.

    > original query string
    >
    > http://192.168.1.1/rocket.pl?page=1&keywords_string=3
    >
    > new query string
    >
    > http://192.168.1.1/rocket.pl?page=1&keywords_string=3
    > &.submit=Submit+Query
    >
    > what does this mean?


    Could you explain why you care?

    Sinan

    --
    A. Sinan Unur <>
    (remove .invalid and reverse each component for email address)

    comp.lang.perl.misc guidelines on the WWW:
    http://www.rehabitation.com/clpmisc/
     
    A. Sinan Unur, Apr 13, 2008
    #2
    1. Advertising

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. David Williams
    Replies:
    2
    Views:
    1,171
    Jacob Yang [MSFT]
    Aug 12, 2003
  2. Bernard Segonnes

    Print and print overview and current page

    Bernard Segonnes, Nov 4, 2004, in forum: Java
    Replies:
    0
    Views:
    467
    Bernard Segonnes
    Nov 4, 2004
  3. keto
    Replies:
    0
    Views:
    1,043
  4. David Cournapeau

    print a vs print '%s' % a vs print '%f' a

    David Cournapeau, Dec 30, 2008, in forum: Python
    Replies:
    0
    Views:
    399
    David Cournapeau
    Dec 30, 2008
  5. zippy

    cgi and cgi-bin

    zippy, Feb 1, 2005, in forum: Perl Misc
    Replies:
    5
    Views:
    466
    Sam Holden
    Feb 2, 2005
Loading...

Share This Page