MyBB Community Forums

Full Version: Using the search function from another page on the site?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Can I create a searchbox on another part of my site and send that request to the search.php page in the forums?
yes, you can. use the path for search.php file ... { eg. <form action="forum URL/search.php" ........ }

Thank you for the response. What do i put after the search.php to search for a keyword? I've tried a few things...

[forumurl]/search.php?keyword=donuts

^ I could not get it - why you need key words ? I thought you are adding a search form outside forum !
Yes I am, but I need to pass search.php the form information don't I?

I have a form, when you submit action=search.php but all that does it take you to the search.php page it doesnt actually run the query.
try like this
<form method="post" action="http://community.mybb.com/search.php">
				<input name="action" value="do_search" type="hidden">
				<input name="postthread" value="1" type="hidden">
				<input name="forums" value="all" type="hidden">
				<input name="showresults" value="threads" type="hidden">
				<input class="textbox" name="keywords" value="Search..." onfocus="if(this.value == 'Search...') { this.value = ''; }" onblur="if(this.value=='') { this.value='Search...'; }" size="25" type="text">
<input class="button" value="Search" type="submit">
<br class="clear">
</form>