Hello every1, i have issue regarding Paging using filterexpression. here's the piece of code for filtering :
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"
and here's chunk of the paging code:
print qq[<td><a href="UsersList.cgi?
pageNum=$pageN&limit=$limit&SortBy=$SortBy&SortOrder=$SortOrder"><</a></td>];
THE ISSUE IS I WANT TO PUT THE FILTER EXPRESSION IN THIS HREF AFTER SORTORDER 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..
print qq[<td><a href="UsersList.cgi?
pageNum=$pageN&limit=$limit&SortBy=$SortBy&SortOrder=$SortOrder
&Filter=$filterexpression"><</a></td>];
but in url i got to see something like this:
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
Later i tried to put the "$Id" value in a varible like :
$string =~ m/^$Id/;
but when i tried printing this variable i got nothing. Please do help me out with a solution.Thank you.