PHP搜索函数生成服务器超时

PHP搜索函数生成服务器超时,php,search,Php,Search,我有一个PHP搜索函数,在提交html表单时触发。我注意到,当我输入一个长度超过4-5个字符的字符串时,搜索超时。数据库中有2000多条记录,这就是它无法返回搜索结果的原因吗 $country=$HTTP_POST_VARS['country']; $catagory=$HTTP_POST_VARS['catagory']; $pricemin=$HTTP_POST_VARS['pricemin']; $pricemax=$HTTP_POST_VARS['pricemax']; $sort=$H

我有一个PHP搜索函数,在提交html表单时触发。我注意到,当我输入一个长度超过4-5个字符的字符串时,搜索超时。数据库中有2000多条记录,这就是它无法返回搜索结果的原因吗

$country=$HTTP_POST_VARS['country'];
$catagory=$HTTP_POST_VARS['catagory'];
$pricemin=$HTTP_POST_VARS['pricemin'];
$pricemax=$HTTP_POST_VARS['pricemax'];
$sort=$HTTP_POST_VARS['sort'];
$searchword=$HTTP_POST_VARS['searchword'];

$search = '?'.'catagory='.$catagory.'&country='.$country;

if ( $pricemax <> '' )
    $search = $search.'&pricemax='.$pricemax;
else
    $search = $search.'&pricemin=0';
if ( $pricemax <> '' )
    $search = $search.'&pricemax='.$pricemax;
if ( $sort <> '' )
    $search = $search.'&sort='.$sort;
if ( $searchword <> '' )
    {
    $wordformated = str_replace(" ", ",", $searchword);
    $search = $search.'&searchword='.$wordformated;
    }

header("Location: results.php".$search);    
$country=$HTTP_POST_VARS['country'];
$catagory=$HTTP_POST_VARS['catagory'];
$pricemin=$HTTP_POST_VARS['pricemin'];
$pricemax=$HTTP_POST_VARS['pricemax'];
$sort=$HTTP_POST_VARS['sort'];
$searchword=$HTTP_POST_VARS['searchword'];
$search='?'.'catagory='.$catagory.&country='.$country;
如果($pricemax“”)
$search=$search.&pricemax='.$pricemax;
其他的
$search=$search.&pricemin=0';
如果($pricemax“”)
$search=$search.&pricemax='.$pricemax;
如果($sort“”)
$search=$search.&sort='.$sort;
如果($searchword“”)
{
$wordformatted=str_replace(“,”,“,$searchword);
$search=$search.&searchword='.$wordformatted;
}
标题(“位置:results.php”。$search);

下面是调用php文件的表单标记:这是新代码还是旧代码?我不知道有多久没看到HTTP\u POST\u VARS了!无论如何,放一个
die('here')就在
标题
语句的前面。那么,你所有的疑问发生得真的很快吗?如果是这样,问题就出在results.php上。这不是搜索脚本。此代码生成要重定向的url<代码>结果。php
执行搜索。是的,这是旧代码!太旧了,谢谢你的帮助!他们重新启动了运行PHP4版本的(古老的)服务器,解决了这个问题?我不知道有多久没看到HTTP\u POST\u VARS了!无论如何,放一个
die('here')就在
标题
语句的前面。那么,你所有的疑问发生得真的很快吗?如果是这样,问题就出在results.php上。这不是搜索脚本。此代码生成要重定向的url<代码>结果。php
执行搜索。是的,这是旧代码!太旧了,谢谢你的帮助!他们重新启动了运行PHP4某些版本的(古老的)服务器,解决了这个问题。