I have issue regarding paging using filter expression. Here's the piece of code for filtering:
and here's chunk of the paging code:
The issue is I want to put the filter expression in this HREF after the sort order variable,
so that after filtering when I go for paging then only those records confined to the filter expression should be shown.
I tried to merge this way:
but in URL I got to see something like this:
Later I tried to put the `$Id` value in a varible like:
but when I tried printing this variable I got nothing.PLEASE HELP ME OUT FIND THE SOLUTION,and apart from using CPAN is their any other solution because i am having 0% knowledge about it.
Code:
if ( $q->param("Filter") ) { $Id=$q->param('User_Id'); $Name=$q->param('User_Name'); if ($Id ne "" ) { $filterexpression= $filterexpression." UserId like '" .$Id. "%' and " ; } if ($Name ne "" ) { $filterexpression= $filterexpression." UserName like '" .$Name. "%' and " ; } } $filterexpression= $filterexpression. " UserId > 0"
Code:
print qq[<td><a href="UsersList.cgi? pageNum=$pageN&limit=$limit&SortBy=$SortBy&SortOrder=$SortOrder"><</a></td>];
so that after filtering when I go for paging then only those records confined to the filter expression should be shown.
I tried to merge this way:
Code:
print qq[<td><a href="UsersList.cgi? pageNum=$pageN&limit=$limit&SortBy=$SortBy&SortOrder=$SortOrder &Filter=$filterexpression"><</a></td>];
Code:
http://localhost/cgi-bin/UsersList.cgi? pageNum=1&limit=3&SortBy=UserId&SortOrder=Asc&filter=%20%20UserId%20like% 20'1%'%20and%20%20UserId%20>%200
Code:
$string =~ m/^$Id/;
Comment