Adding my own search facility within WP posts (2 posts)

  1. hasanali00
    Posted 9 years ago #


    I wonder if following is possible.

    Can I create a post within WP, that has a textbox and a Submit button. I want the users to enter a keyword into this textbox and press Submit button. I will write the PHP-MySQL code to search for that keyword in a database. Then I want to display the search result witnin the SAME post.

    Can I do this?

    If you can give some examples how to achieve this, I would appreciate this.


  2. davidchait
    Posted 9 years ago #

    not a 'post', but a 'page'. Create a custom page template that does all the code handling under the covers, make sure it is securely posting the search to itself (i.e., clean up any posted form data so it can't be used to hack your site), and create a page and set that to be its custom template. all done. ;)

    Read up on custom page templates on the codex.

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.