如题,楼主目前写的是一个简单的爬虫程序,是这样的,
index.php中用表单输入两个关键词和选择搜索引擎,然后用action传送到getdata.php页面,
getdata根据选择搜索引擎的不同转向 baidu.php 或者360.php,
在baidu.php 或者360.php里都要调用news_functions.php,就是在这个news_functions.php里有个函数一直报错Warning: substr_count() [function.substr-count]: Empty substring in C:\AppServ\www\yuqing1\spider\news\news_functions.php on line 346
function is_include_ahu($str)
{
$ahuKeyWords[1]=$_GET[word1];
$ahuKeyWords[2]=$_GET[word2];
for($i=0; $i<count($ahuKeyWords); $i++)
if( substr_count($str, $ahuKeyWords[$i]) )
return true;
return false;
}
我觉得应该是word1和word2里面值没有传到news_functions页面,请问各位怎么解决,麻烦说详细点,谢谢!