Jump to content

Search q parameter is not being passed


Recommended Posts

On a new install (copy of an absolutely fine-working PW) the search is not working. And it's really strange: same server, same PHP versions etc.

The q parameter is not recognized by PHP. I tried to echo $_GET["q"] as well, but the var is empty.

The search URL is just domain.tld/search/ - instead of domain.tld/search/?q=hello

If I manually add the param in the URL: /search/?q=something, the search results are shown as expected. Error log doesn't show anything

I also checked any .htaccess files, whether something else hijacks the q param for mod_rewrite - nothing

Any ideas where to look further?

Link to comment
Share on other sites

Welcome to the forums!

I'd start by checking the search form, particularly as rendered in a browser. Does everything seem OK, and in particular, is the value of the 'action' attribute as expected for the search page?

Another possible cause might be caching, so if caching is on for the search page I'd turn it off (Templates > name-of-search-template > Cache). And if you have any other sort of caching running, you could try with that turned off too.

  • Like 1
Link to comment
Share on other sites

On 10/23/2021 at 8:07 PM, CarmeloLabadie said:

The search URL is just domain.tld/search/ - instead of domain.tld/search/?q=hello

If I manually add the param in the URL: /search/?q=something, the search results are shown as expected. Error log doesn't show anything

Also, make sure that your search form and results template use the correct request method (GET vs. POST), as having "<form method='POST'>" in the HTML and reading $input->get->q in PHP would explain the behavior.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...