<?php

$vercode='';	//此处取值请自行修改
if(isset($_POST['vercode'])){
if ($_POST['vercode']!=$vercode){
	echo("[err]invalid vercode[/err]");
	exit();
}
}


define('NOROBOT', TRUE);
define('CURSCRIPT', 'search');


	require_once './include/common.inc.php';
	$keyword = isset($subject) ? htmlspecialchars(trim($subject)) : '';
	if ($keyword==''){
	echo('[err]no subject[/err]');
	exit();
	} 
	if (isset($fid) && ($fid!=0) && ($fid!='')){
	$srchstring=' and fid = '.$fid ;
	}
	else
	{
	$srchstring='';
	}
	
	$query = $db->query("SELECT * FROM {$tablepre}threads WHERE subject= '{$keyword}' ".$srchstring." LIMIT 1");
	if ($db->num_rows($query)>0){
	echo('1');
	}
	else
	{
	echo('0');
	}

$db->close;
exit();

?>