Embed Search Box and Results In Another Web Page

Come here for help or to post comments on Sphider
Post Reply
ferguson4848
Posts: 1
Joined: Wed Jun 12, 2019 8:41 pm

Embed Search Box and Results In Another Web Page

Post 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!
User avatar
captquirk
Site Admin
Posts: 299
Joined: Sun Apr 09, 2017 8:49 pm
Location: Arizona, USA
Contact:

Re: Embed Search Box and Results In Another Web Page

Post 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.
Post Reply