Page 1 of 1

Embed Search Box and Results In Another Web Page

Posted: Wed Jun 12, 2019 8:43 pm
by ferguson4848
I'm wondering if there is a way to embed with a PHP include or require the search.php page into another PHP on my site. The idea being a visitor would be on an existing page and insert a query into the search form, pressed Search and the page would reload, but now display the search results within the existing page.

I've tried including search.php in a page, but all I get is blank page when it is run.

Anyone had any success with this.

Thank you!

Re: Embed Search Box and Results In Another Web Page

Posted: Thu Jun 13, 2019 1:45 am
by captquirk
You can easily embed the query on any page, but the results will appear on the search.php page.

Another approach is to customize the search.php page. Instead of embedding search.php on your page, you are embedding your content in search.php. You can still have query boxes on other pages, with results appearing on search.php.

Here is an excellent example of a customized search page: http://www.gurbani.org/spsearch/search.php.