#!/usr/bin/perl use CGI; my $cgi=new CGI; print $cgi->header; $region = $cgi->param("region"); print <<HERE1; <body> <table WIDTH="525" border="0" cellpadding="0" cell +spacing="0"> <tr><td valign="top" class="bodycont +ent-txt"><p>cant excute the cgi what to do please help. </p></td></tr +> <tr><td valign="top" class="bodycontent-txt"><p>c +ant ee xcute the cgi please help</p></td></tr> <tr><td valign="top" class="bodycontent-txt"><p>c +ant excute the cgi what to do please help. cant excute the cgi what t +o do please help. </p></td></tr> <tr><td valign="top" class="bodycontent-txt"><p> +cant excute the cgi what to do please help. cant excute the cgi what +to do please help. cant excute the cgi what to do please help. </p></ +td></tr> <tr><td valign="top" class="bodycontent-txt">< +img src="images/spacer.gif" width="10" height="10" alt="" ></td></tr> <tr><td valign="top" class="bodycontent-txt"><p>< +strong>In Europa</strong></p></td></tr> <tr><td valign="top" class="bodycontent-txt"> HERE1 pageNumbers(); print <<HERE1; </td></tr> </table> </BODY> HERE1 sub pageNumbers { $count = 0; open (FIN, "data.txt") or die "cant open the file "; while(<FIN>) { $count++ } $totalcount= $count; print "$totalcount \n \n "; #so put all the values inside an array say @total. $no_per_page=15; $total_pages=int((scalar $totalcount) / $no_per_page); print "$total_pages \n \n "; $remainder = (scalar $totalcount) % $no_per_page; if ($remainder) { $total_pages++; print $total_pages; } if($total_pages) { print <<"END"; <table cellpadding="0" cellspacing="0" bor +der="0" width="100%"> <tr> <td class="smtxt"> END print "<b>Page </b>"; for $i (1 .. $total_pages) { if ($i == $page) { print "<b>$i</b>"; } else { print "<a href=\"categories.cgi ?page=$i&peri +od=$period\">$i</a>"; } if ($i != $total_pages) { print " | "; } } print "<!-- '$total_pages' '$remainder' --></td></tr></table>\ +n"; } } 1;
READMORE tags added by Arunbear
In reply to problem in href and pagination by rjsaulakh
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |