CGI.PM and print table

D

dtshedd

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
 
A

A. Sinan Unur

(e-mail address removed) wrote in
@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 <[email protected]>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top