Submit button does not run PHP

i am trying to create a custom php search function that uses data from my own sql table.
I have a search button that uses post to call search-database.php

Where should this php file be located as it doesn’t seem to be called when I hit the search button.

web page = www.buxtonguide.com/search

Hello There,

Thanks for writing in! It seems that you have customized the search function incorrectly. Please check out this tutorials on how you can create your own search.
https://codex.wordpress.org/Creating_a_Search_Page

Hope this helps.

Excellent, thanks for the links

You are most welcome!

These links are no good as I don’t want to use Wordpress Search. I need to search my own custom tables.

So ignoring the fact this is a search page. I have some php how to I get this to run when a user clicks on the button, where should I store the php on the file system ?

Thanks.

Hello There,

The only way for the search submit button to work and perform your custom search is to modify the search form. The links I have provided is an example of how you can customize the search form.

Regretfully, this particular customization request is outside the scope of our support as this is not related to an issue with the theme and instead has to do with your customization of it. As such, you will need to investigate this particular issue on your own or seek help from a developer should you not feel comfortable making these changes yourself.

Thank you for your understanding.

i have read the above links, they suggest that i need to edit the search.php template file. whilst i understand support is not available for the actual edit. where do find this file ?

Hi There,

Can you try a plugin to extend your search functionality (https://wordpress.org/plugins/search-everything/).

Thanks!

Hi sorry i didn’t make myself clear. Its not the search functionality i am after. this works fine, i use the Relevanssi plugin to do the search and this returns the actual data.

What i want to do is customise the search results page. Where do I find this ?

Thanks
Geoff

if you go to search and enter “tyres” or “drug” and see the results the page is auwful. how do i improve the appearance.

Hi Geoff,

If you want to customize the search results page, you will have to create a template file which is the search,php file that is suggested in the first link @RueNel provided.

For it to be easier, I suggest that instead of creating your custom template for the search results page, you can simply add some CSS to style the page.

Hope this gets you started.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.