<?php
	require 'Run.php';
	function getGro($id){
		$result = mysql_query("SELECT url,id FROM mkinfo WHERE id='{$str}'"); 
		if($result && mysql_num_rows($result)>0){
	    list($url,$id) = mysql_fetch_row($result);
		return $url;
		}
		else
		{
		return 'error/nofindpage.php';
		}

	}
	function getback(){
		if($_GET['backurl'] != null)
		{
			return base64_decode($_GET['backurl']);
		}
		return 'http//'.$_SERVER['HTTP_HOST'];
	}
	echo head('搜索结果');
	echo topNav($_GET['s'].'的搜索结果',' <a href="'.getback().'">返回</a>',' ');
	$sql = 'SELECT * FROM '.$_GET['t'].' WHERE title like \'%'.$_GET['s'].'%\'';
	$sql_array = mysql_query($sql);
	if($sql_array && mysql_num_rows($sql_array) > 0)
	{	
		$nums = 0; 
			while($value = mysql_fetch_array($sql_array))
			{	
				$div = $num++%2 == 0?'line1':'line2';
				echo '<div class="'.$div.'"><a href="/'.$_GET['t'].'/content.php?cid='.$value['gro'].'&id='.$value[$_GET['t'].'id'].'">'.$value['title'].'</a></div>';
			}
	}
	echo footer(1);