PHP中的页面重定向而不是echo

I am using a Magento website. If anyone searches for a product and if the product is not found, it displays 'No match found'.

I have pasted the script below:

<div id="partfinder_<?php echo $this->getInstanceSufix(); ?>_not_found" 
     style="display:none"><?php echo $this->__('No matches found.') ?></div>    

I want the users to be redirected to the new page where they can fill out an enquiry form.

It is belong form magento ,,

you can check it form 2 side
1- Go into Catalog Block product list in core file and check there product size and redirect .. where you want..

2- from frontend /design/yourtheme/default/template/catalog/product/list.phtml if no item then redirect it by header('location:url');die;

You can create yourself a module that listens for the index action on the catalogsearch modules' result-controller.

Then you check if the result is empty by inspecting the query model obtained from that module helper:

$query = Mage::helper('catalogsearch')->getQuery();
/* @var $query Mage_CatalogSearch_Model_Query */

$query->setStoreId(Mage::app()->getStore()->getId());

If you then want to trigger a redirect on any query, just overwrite the redirect data-member and by making the object unsaveable:

$query->setRedirect('/your/redirect/uri');
$query->setId(null);
$query->isDeleted(true);

Then the layout of the result won't render but instead the controller action will do the redirect for you. You can see that within the method Mage_CatalogSearch_ResultController::indexAction() (app/code/core/Mage/CatalogSearch/controllers/ResultController.php). Just look for a place that is easy to interact with by going through with a step-debugger like xdebug. The underlying EAV model with implications on search is documented here as well: Magento EAV System (Solving Magento).

See as well: