Search - Results Page

3 posts by 2 authors in: Forums > CMS Builder
Last Post: September 11, 2012   (RSS)

By Perchpole - September 11, 2012

Hello, All -

I would like to direct my searches to a specific results page at the following address:

./index.php?cat=2&q=searchquery

However, even though I add the required code to the "action" element of the search form, it simply ignores cat=2.

Consequently, the results page is always just:

./index.php?q=searchquery

How can i get around this?

:0/

Perch

Re: [Perchpole] Search - Results Page

By gregThomas - September 11, 2012

I think the problem is that the form is ignoring the data you have attached to the action element of the url and replacing it with it with the form data when you press the send button. To get around this change the action element to index.php and add a hidden field into the form with the category you want.

<input type="hidden" name="cat" value="2" />

This will then appear in the url along with your search query when the form is sent. You can use the hidden input to pass any information that you don't want the user to be able to see or easily edit.
Greg Thomas







PHP Programmer - interactivetools.com

Re: [greg] Search - Results Page

By Perchpole - September 11, 2012

Hi, Greg -

That's great. It works!

:0)

Perch