Hi all, thanks for your suggestions. My solution
is appended below. Passing the hidden field
$input solved my problem...
Regards,
Stacy.
use CGI qw(:standard :netscape *table);
use CGI::Carp qw(fatalsToBrowser);
use CGI::Pretty qw( :html3 );
use strict;
my ($order_by,$sql,$order_by_check,$order_by_input);
$sql = qq{SELECT * FROM TABLE};
$order_by = param('order_by');
$order_by_check = param('order_by_check');
if ($order_by) {
$sql .= " ORDER BY $order_by ";
if ($order_by_check eq $order_by) {
$sql .= ' DESC ';
$order_by_check = $order_by;
} else {
$sql .= ' ASC ';
$order_by_input = "<INPUT TYPE=hidden NAME=order_by_check VALUE=\"
+$order_by\">";
}
}
print header,
start_html(),
start_form(),
center(
start_table(),
Tr(td(submit('order_by','FAULT_NO',)),
td(submit('order_by','ISSUE')),
td(submit('order_by','RESPONSE'))),
end_table(),
p($sql),
$order_by_input,
),
end_form(),
end_html();
exit;
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.