PDA

View Full Version : How to handle search_template.html with PHP?


vcor
01-14-2008, 10:12 PM
It's worked well in our test site, but we use PHP on all our pages. When we place any PHP inside the search_template.html it gets ignored. Any tricks to making this work?

While we can insert the form into a PHP without a hitch, as soon as you get the results, it seems to always use the search_template.html.

I spent some time trying the Configure/Advanced/Embedding script option but it's not quite clear if this is the option to use. In that attempt I set that option to "http://www.MySite.com/search/index.php". I created the page "/search/index.php" that has all our PHP code and attempted to insert the search.php file at the location where we want it to appear, with a line:
<?php include("search.php"); ?>
But this didn't work at all (server error). They are both in the same directory. The help wasn't too clear on how this option is used, so I was just guessing it might be what's needed.

P.S. Thanks for the search boxes FAQ! ((http://www.wrensoft.com/zoom/support/searchbox.html)

Ray
01-14-2008, 11:32 PM
What you are after is answered in this FAQ:
Q. How can I add server-side scripting (eg. PHP, ASP) to the search template? (http://www.wrensoft.com/zoom/support/faq_ssi.html)

You were on the right track to try to include the search.php file within your own PHP script. The above FAQ gives more details, and perhaps you will find the virtual() function being more suitable. If you still have trouble, let us know.