仍有以下错误 Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\Apache\Apache2\htdocs\11\search.php:10) in C:\Apache\Apache2\htdocs\11\search.php on line 42Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\Apache\Apache2\htdocs\11\search.php:10) in C:\Apache\Apache2\htdocs\11\search.php on line 42 select * from movie where movie_name LIKE '%英雄%'
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\Apache\Apache2\htdocs\11\search.php:10) in C:\Apache\Apache2\htdocs\11\search.php on line 42Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\Apache\Apache2\htdocs\11\search.php:10) in C:\Apache\Apache2\htdocs\11\search.php on line 42
select * from movie where movie_name LIKE '%英雄%'
<?php
if (!isset($_SESSION["searchstr"]) && !isset($_SESSION["manname"]))
{
//注册一个session;
session_start();
session_register('searchstr');
session_register('manname');$search_str=$_POST["search_str"];
$search_style=$_POST["man_name"];$_SESSION["searchstr"]=$search_str;
$_SESSION["manname"]=$search_style;
} require "con_db_php.inc";
$newcon= new con_data;
$newcon->condb();
//echo $_SESSION["searchstr"];
if ($_SESSION["searchstr"]=="")
{
echo ("请输入要搜索的关键词。");
}
$pages=$_GET["pages"];
if(!isset($pages))
{
$pages=1;
}
if($pages==0)
{
$pages=1;
}
//echo ("$search_str");
//echo ("$search_style");
if ($_SESSION["searchstr"]!="")
{
if ($manname==1)
{
$query="select * from movie where words LIKE '%".$_SESSION["searchstr"]."%'";
//echo $query;
}
else
{
$query="select * from movie where movie_name LIKE '%".$_SESSION["searchstr"]."%'";
//echo $query;
}
$gPageSize= 20; //每页显示的记录数
$result = @mysql_query($query);
$rows=@mysql_num_rows($result);
$a_row = @mysql_affected_rows($result);
//得到当前查询到的纪录数 $nNumRows
if($rows<=0)
{
echo "<font size=2>抱歉!没有纪录</font>";
exit;
}
//得到最大页码数MaxPage
$MaxPage = (int)ceil($rows/$gPageSize);
if((int)$pages > $MaxPage)
{
$pages=$maxPage;
}
//echo "<font size=2>第$pages 页,共 $MaxPage 页</font><br><br>";
if( mysql_data_seek($result,($pages-1)*$gPageSize) )
for($i=0; $i<$gPageSize; $i++)
{
//@mysql_data_seek($result, $i);
$data = @mysql_fetch_array($result);
$Idd=$data[Id];
if ($Idd!="")
{
$name = $data[movie_name];
$address = $data[address];
$conok=$data[con_ok];
$conno=$data[con_not];
echo "<tr>";
echo "<td> $name</td>";
echo "<td>$address</td>";
echo "<td> $conok</td>";
echo "<td> $conno</td>";
//echo "<td> <a href=look.php?id=".$Idd."><font size=2>查看</font></a>";
//echo "<td><a href=poop.php?id=".$Idd."><font size=2>投票</font></a></td>";
echo "<td>";
echo "<img src=\"image\yes.gif\" border=0 style=\"cursor:hand;\" onClick=\"window.open('pool.php?style=1&Idd=".$Idd."','','width=300,height=200')\">";
echo "<img src=\"image\isno.gif\" border=0 style=\"cursor:hand;\" onClick=\"window.open('pool.php?style=2&Idd=".$Idd."','','width=300,height=200')\">";
echo "</td>";
echo "</tr>";
}
?>
<?php
}
}
$newcon->db_close();
?>