读书人

网站在检索时遇到异常。 该网站可能关

发布时间: 2012-05-11 12:55:37 作者: rapoo

网站在检索时遇到错误。 该网站可能关闭进行维护或配置不正确。
我的文件上传到服务器,打开网站提示:

网站在检索 http://www.hu0010.com/ 时遇到错误。 该网站可能关闭进行维护或配置不正确。

不知道是怎么回事,一开始我是index.html上传的,但是里面的PHP代码好像都不能用,其它都显示正常,然后另存为index.php后再打开就出现上面的提示,跟本就打不开了!



网站内容index.php


<!DOCTYPE HTML>

<html>

<head>

<meta charset="utf-8" />

<title>博客</title>

<link type="text/css" rel="stylesheet" href="css/layout.css" />

</head>

<body>

<!--页头-->

<div id="header">

<div id="time">



<div id="logo"><img src="images/logo.gif" alt="logo" /></div>

<div id="xuanchuan"><p>“Hello World!”</p></div>

</div>

<!--清除浮动--><div class="clearfloat"></div>

<!--导航-->

<div id="nav_bg">

<div id="nav">

<div id="nav_left">

<ul>

<li><a class="daohang" href="index.html">首页</a></li>

<li><a href="blog.html">博文</a></li>

<li><a href="reply.html">留言板</a></li>

</ul>

</div>

<div id="nav_right">

<form id="sousuo" action="" method="get">

<input type="text" id="sou" name="keys" />

<input type="submit" id="suo" name="subs" value="搜索" />

</form>

</div>

</div>

</div>

<!--清除浮动--><div class="clearfloat"></div>

<!--正文-->

<div id="main">

<!--正文左-->

<div id="main_left">

<div class="shouye">

<?php

include("conn.php");

?>

<?php

if(!empty($_GET['keys'])){

$w="`title` like '%".$_GET['keys']."%'";

}else{

$w=1;

}

//分页

$pagesize=10; //每页显示条数

$rs=mysql_fetch_row(mysql_query("select count(*) from `blog`"))[0]; //得出记录总数

$pages=ceil($rs/$pagesize); //总数/条数=页数 ceil代表 有余进1

//这句就是获取page中的page的值,假如不存在page,那么页数就是1。

$page=isset($_GET['page'])?intval($_GET['page']):1;

$offset=$pagesize*($page - 1); //

$query=mysql_query("select * from `blog` order by id desc limit $offset,$pagesize");



while($rs=mysql_fetch_array($query)){

?>

<h2><a href="content.html?id=<?php echo $rs['id'] ?>"><?php echo $rs['title'] ?></a></h2>

<p class="dates"><?php echo $rs['date'] ?></p>

<p class="contents"><?php echo $rs['content'] ?></p>

<p class="yuedu"><a href="content.html?id=<?php echo $rs['id'] ?>">阅读全文>></a>

类别:

<?php

switch($rs['f_id']){

case 1:

echo "个人日志";

break;

case 2:

echo "分类2";

break;

case 3:

echo "分类4";

break;

case 4:

echo "分类4";



break;

default:

echo "未分类";

}

?>

</p>

<!--清除浮动--><div class="clearfloat"></div>

<?php

}

?>

<!--清除浮动--><div class="clearfloat"></div>

<p class="fenye">

<?php

//输出分页

$shouye=1;

$shangye=$page-1;

$xiaye=$page+1;

$weiye=$pages;

if($page>1){

echo "<a href='index.html?page=".$shouye."'> 第一页 </a>";

echo "<a href='index.html?page=".$shangye."'> 上一页 </a>";

}

for($i=1;$i<=$pages;$i++){

if($i<$page+5&$i>$page-5){

$show=($i!=$page)?"<a href='index.html?page=".$i."'> ".$i." </a>":"<strong>$i</strong>";

echo $show." ";

}

}

if($page<$pages){

echo "<a href='index.html?page=".$xiaye."'> 下一页 </a>";

echo "<a href='index.html?page=".$weiye."'> 最后一页 </a>";

}

//下拉跳转列表,循环列出所有页码:

if($pages>20){

echo " 跳至<select onchange='window.location=\"index.html?page=\"+this.value'>";

for($i=1;$i<=$pages;$i++){

$tz=($i==$page)?"<option value='$i' selected>$i</option>":"<option value='$i'>$i</option>";

echo $tz;

}

echo"</select>页";

}

?>

</p>

</div>

</div>

<!--正文右-->

<div id="main_right">

<div class="dianji">

<h2>文章分类</h2>

<ul>

<li><a href="blog.html?class=1" title="个人日志">个人日志(<?php echo $rs=mysql_fetch_row(mysql_query("select count(*) from `blog` where `f_id`=1"))[0] ?>)</a></li>

<li><a href="blog.html?class=2" title="个人日志">分类2(<?php echo $rs=mysql_fetch_row(mysql_query("select count(*) from `blog` where `f_id`=2"))[0] ?>)</a></li>

<li><a href="blog.html?class=3" title="个人日志">分类3(<?php echo $rs=mysql_fetch_row(mysql_query("select count(*) from `blog` where `f_id`=3"))[0] ?>)</a></li>

<li><a href="blog.html?class=4" title="个人日志">分类4(<?php echo $rs=mysql_fetch_row(mysql_query("select count(*) from `blog` where `f_id`=4"))[0] ?>)</a></li>

</ul>

</div>

<!--清除浮动--><div class="clearfloat"></div>

<div class="dianji">

<h2>阅读排行</h2>

<ol>

<?php



$query=mysql_query("select * from `blog` order by `blog`.`read` desc limit 10 ");



while($rs=mysql_fetch_array($query)){



?>

<li><a href="content.html?id=<?php echo $rs['id'] ?>"><?php echo $rs['title'] ?></a></li>

<?php

}

?>

</ol>

</div>

<!--清除浮动--><div class="clearfloat"></div>



<div class="dianji">

<h2>评论排行</h2>

<ol>

<?php



$query=mysql_query("select * from `blog` order by `blog`.`comment` desc limit 10 ");



while($rs=mysql_fetch_array($query)){



?>

<li><a href="content.html?id=<?php echo $rs['id'] ?>"><?php echo $rs['title'] ?></a></li>

<?php

}

?>

</ol>

</div>

</div>

</div>

<!--清除浮动--><div class="clearfloat"></div>

<!--页脚-->

<div id="footer">



<p>Copyright (C) 2006-2012 hu0010.com, All Rights Reserved</p>



</div>

<!--清除浮动--><div class="clearfloat"></div>

</body>

</html>

[解决办法]
尝试上传一个文件看看能不能显示?

PHP code
<?phpphpinfo();?>
[解决办法]
报什么错?

读书人网 >PHP

热点推荐