I'm writing a plugin to search for property rentals.
I have created a page with the search form in it (min / max price, number of bedrooms etc). The page works this way:
* The page has a shortcode in it
* The shortcode ends up calling a function which displays the search form (as <form ... etc </form>)
This bit I understand.
However what should the 'action' of the form be? Should it be the current page (which would actually run the plugin's main PHP script)? Or should it be something like "http://www.mydomain.com/property_search.php"?
I noticed that if the action points to the 'current script' and I display the search results if $_GET is set, then it mostly works. The only issue is that the text before the shortcode is displayed before the search results which looks odd.
Any ideas how to:
1) Use forms properly? i.e. what should the 'action' in the <form> be?
2) How do I display the search results without the text before the shortcode in the page?
If this doesn't make sense I'll try and make it more clear. The lack of clarity in my writing may well relate to my lack misunderstanding of Wordpress. Apologies in advance.