Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1838714
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T06:31:24+00:00 2026-05-17T06:31:24+00:00

i have issue regarding Paging using filterexpression. here’s the piece of code for filtering

  • 0

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">&lt;</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">&lt;</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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T06:31:27+00:00Added an answer on May 17, 2026 at 6:31 am

    I think you just need to escape the output of your variables. URLs reserve certainvariables % being one of them, so you end up requesting something different than you are expecting. change your link output code to be the following:

    $limitEnc = urlencode($limit);
    $pageNEnc = urlencode($pageN);
    $SortByEnc = urlencode($SortBy);
    $SortOrderEnc = urlencode($SortOrder);
    $filterexpressionEnc = urlencode($filterexpression);
    print qq[<td><a href="UsersList.cgi?
                pageNum=$pageNEnc&limit=$limitEnc&SortBy=$SortByEnc&SortOrder=$SortOrderEnc&Filter=$filterexpressionEnc">&lt;</a></td>];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an issue regarding conversion from float to c++ string using ostringstream. Here
I have a little issue here regarding the modification of Web.Config files in Feature
I have an issue that is driving me a bit nuts: Using a UserProfileManager
We have an issue using the PEAR libraries on Windows from PHP . Pear
I have an issue with using AWK to simply remove a field from a
I have an issue regarding the use of the following regular expression: private Regex
I have an issue regarding an recursive count which works well in SQL server,
I have an issue regarding to auto populating a select dropdown from jQuery/JSON data
I have an issue regarding sending form values to a script. I have a
I have a puzzling issue regarding modules defined in the lib dir I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.