I thought these worked and haven't changed anything but it seems a variable is blank in the path. Here is the path I get online with the following code:
.../db.cgi?db=default&uid=xxx&view_records=1&so=&ID=*&sb=32&so=ascend
Seems it's getting the first so from $new_url and the second from the html. Why is it blank? What is wrong with this code:
# Go through each hit and convert the array to hash and send to
# html_record for printing.
$new_url = $ENV{'QUERY_STRING'};
$new_url =~ s/\&sb=\d+//;
$new_url =~ s/\&so=\w+//;
for ($col=0; $col <=$#db_cols; ++$col) {
if ($in{'sb'} == $col) {
if ($in{'so'} eq 'descend') { $sb[$col] = 'ascend'; }
else { $so[$col] = 'descend'; }
}
else { $so[$col] = 'ascend'; }
}
# Note: In each of the header cells, replace # with the field number
# of the field that is associated with that header -- in both places within each line.
print qq|
<TABLE border=1 width=90% align=center>
<TR>
<TD align=center><a href="$db_script_url?$new_url&sb=0&so=$so[0]">ID</a></TD>
<TD><a href="$db_script_url?$new_url&sb=17&so=$so[17]">Domain</a></TD>
<TD><a href="$db_script_url?$new_url&sb=2&so=$so[2]">Name</a></TD>
<TD><a href="$db_script_url?$new_url&sb=3&so=$so[3]">Company</a></TD>
<TD><a href="$db_script_url?$new_url&sb=30&so=$so[30]">Status</a></TD>
<TD><a href="$db_script_url?$new_url&sb=29&so=$so[29]">Paid?</a></TD>
<TD><a href="$db_script_url?$new_url&sb=32&so=$so[32]">Price</a></TD>
<TD><a href="$db_script_url?$new_url&sb=26&so=$so[26]">IP Address</a></TD>
</TR>\n|;
Thanks!
Chris
.../db.cgi?db=default&uid=xxx&view_records=1&so=&ID=*&sb=32&so=ascend
Seems it's getting the first so from $new_url and the second from the html. Why is it blank? What is wrong with this code:
# Go through each hit and convert the array to hash and send to
# html_record for printing.
$new_url = $ENV{'QUERY_STRING'};
$new_url =~ s/\&sb=\d+//;
$new_url =~ s/\&so=\w+//;
for ($col=0; $col <=$#db_cols; ++$col) {
if ($in{'sb'} == $col) {
if ($in{'so'} eq 'descend') { $sb[$col] = 'ascend'; }
else { $so[$col] = 'descend'; }
}
else { $so[$col] = 'ascend'; }
}
# Note: In each of the header cells, replace # with the field number
# of the field that is associated with that header -- in both places within each line.
print qq|
<TABLE border=1 width=90% align=center>
<TR>
<TD align=center><a href="$db_script_url?$new_url&sb=0&so=$so[0]">ID</a></TD>
<TD><a href="$db_script_url?$new_url&sb=17&so=$so[17]">Domain</a></TD>
<TD><a href="$db_script_url?$new_url&sb=2&so=$so[2]">Name</a></TD>
<TD><a href="$db_script_url?$new_url&sb=3&so=$so[3]">Company</a></TD>
<TD><a href="$db_script_url?$new_url&sb=30&so=$so[30]">Status</a></TD>
<TD><a href="$db_script_url?$new_url&sb=29&so=$so[29]">Paid?</a></TD>
<TD><a href="$db_script_url?$new_url&sb=32&so=$so[32]">Price</a></TD>
<TD><a href="$db_script_url?$new_url&sb=26&so=$so[26]">IP Address</a></TD>
</TR>\n|;
Thanks!
Chris