Implementing Forum Search in External Page

In the previous lesson, we had implemented login detection in a page outside of the forum. Now we want to implement the forum search functionality in the index.php page that is outside of the forum directory.

The idea is to do a view source on the regular forum search page and see how the form is constructed.

We re-created that form (with possible hidden fields for those that we don't want to display) in the HTML code in our external page. Here you see we have re-created all the fields of the form.

But since we only want to show the search field, we use the hidden input field for the other data that is to be submitted along with the search words. Note that we submit to search.php with the mode=results in the query string. We submit via a post instead of a get.

Next Lesson:

See next lesson for some more notes about phpBB.