I have no idea what you're asking, Anon. What do you mean by
can u tell me how i would i convert that href ..name and value query string to normal staring? A few comments about what you're doing, though.
- Use CGI.pm - it will make your life SOOO much easier (and your script easier to read). You might have to redirect STDOUT, either within the script or on the commandline. But, that's trivial.
- PASS VARIABLES AROUND!! If you're calling a function, make that function completely uncoupled from your caller. You've got variables global to the function (if not global to the script!) wandering around and any of those could be compromised.
- If you're not already doing so, use strict and warnings. You will find a number of bugs that way. I guarantee it.
- Pick a consistent formatting system and stick with it. Use one that lays out your logical structure in a consistent manner.
- Allow your strings to go across newlines. For example, the two snippets below are equivalent to the compiler, but the second is sooo much easier to read.
printf RSCrpt "<TR><TD ALIGN=\"left\"><A HREF=\"$cgi\?contract_number=
+$prevValue&member_id=$memberID&start_date=$startMonth$startDay$longSt
+artYear&end_date=$endMonth$endDay$longEndYear&search_page=%s\">%s</A>
+</TD><TD COLSPAN=\"2\" ALIGN=\"center\">%s</TD></TR>\n", $_, $_, $pag
+eCount{$_};
print RSCrpt '<TR><TD ALIGN="left">' .
'<A HREF="' . $cgi . '?' .
'contract_number=' . $prevValue .
'&member_id=' . $memberID .
'&start_date=' . $startMonth$startDay$longStartYear
'&end_date=' . $endMonth$endDay$longEndYear .
'&search_page=' . $_ .
'">' . $_ . '</A>' .
'</TD><TD COLSPAN="2" ALIGN="center">' .
"$pageCount{$_}</TD></TR>\n";
That way, you have all of your &foo=bar stuff lined up and easily read. In addition, each of those prints should be in a function of their own. There is a lot of debate on when you should create a function. My rules of thumb go something like:
- If I use it twice, it's a function.
- Even if I only use it once, if it's complex and hinders readability, it's a function.
- And, most importantly, if you're asking for help, break the problem down to its smallest form and ask for help on that, in a general sense. I'm not going to fix your exact script (especially in its unreadable form), but I will gladly help you if you can explain what the general form of your problem is.
------
/me wants to be the brightest bulb in the chandelier!
Vote paco for President!