为什么这个页面在PHP5.3下不能正常的被执行? 就是访问后很慢,超级慢,状态栏一直显示该页面没有执行完..
我这个页面是以前在PHP5.2下做的, 再放到PHP5.3下运行就不成了..list.php
<?php
include("conn.php");
include("head.php");
?>
<html> <head>
<title></title>
</head> <body>
<table border="0" align="center" width="500" cellpadding="5" cellspacing="1" bgcolor="#add3ef">
<?
$sql="select * from message order by id desc";
$query=mysql_query($sql,$conn);
while($row=mysql_fetch_array($query)){
?>
<tr bgcolor="#eff3ff">
<td>标题:<?=$row[title]?>
用户:<?=$row[user]?>
</td>
</tr>
<tr bgcolor="#ffffff">
<td>
内容:<?
//调用conn.php中的htmtocode函数,过滤替换文件内容
echo htmtocode($row[content]);
?>
</td>
</tr>
<?
}
?>
</table> </body>
</html>conn.php
<?php
$conn = @mysql_connect("127.0.0.1","note","123456") or die("数据库连接出错");
mysql_select_db("simplenote",$conn);
mysql_query("set names 'GBK'"); function htmtocode($content){
$content = str_replace("\n", "<br>", str_replace(" ", " ", $content));
return $content;
}
?>
head.php (这个页面是正常的,里面没有包含PHP代码)
<html> <head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head> <link href="images/css.css" rel="stylesheet" type="text/css">
<b>
<a href="add.php">添加留言</a> |
<a href="list.php">浏览留言</a> |
<a href="login.php">登陆</a>
</b>
<hr size="1"></html>
我这个页面是以前在PHP5.2下做的, 再放到PHP5.3下运行就不成了..list.php
<?php
include("conn.php");
include("head.php");
?>
<html> <head>
<title></title>
</head> <body>
<table border="0" align="center" width="500" cellpadding="5" cellspacing="1" bgcolor="#add3ef">
<?
$sql="select * from message order by id desc";
$query=mysql_query($sql,$conn);
while($row=mysql_fetch_array($query)){
?>
<tr bgcolor="#eff3ff">
<td>标题:<?=$row[title]?>
用户:<?=$row[user]?>
</td>
</tr>
<tr bgcolor="#ffffff">
<td>
内容:<?
//调用conn.php中的htmtocode函数,过滤替换文件内容
echo htmtocode($row[content]);
?>
</td>
</tr>
<?
}
?>
</table> </body>
</html>conn.php
<?php
$conn = @mysql_connect("127.0.0.1","note","123456") or die("数据库连接出错");
mysql_select_db("simplenote",$conn);
mysql_query("set names 'GBK'"); function htmtocode($content){
$content = str_replace("\n", "<br>", str_replace(" ", " ", $content));
return $content;
}
?>
head.php (这个页面是正常的,里面没有包含PHP代码)
<html> <head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head> <link href="images/css.css" rel="stylesheet" type="text/css">
<b>
<a href="add.php">添加留言</a> |
<a href="list.php">浏览留言</a> |
<a href="login.php">登陆</a>
</b>
<hr size="1"></html>
解决方案 »
- 求助-请问谁有全球的省市数据库
- PHP上传多个文件如何写?
- php 不能new com()?
- 在数据库建立了一个用户并赋予了权限。怎样把客户端用户与postgresql数据库中的用户相联系.
- PHP 中用JAVA script中的Confirm,为什么页面背景变成白板?
- 请教一下enom的邮局选项(MX记录)该怎么填?
- PHP结合JAVA解析XML文件,不知道大家对这个感兴趣不。
- php中有没有 与 asp response.clear等同函数
- 请问怎么用php取得只有3个数字组成的5位数字所有集合?
- mysql 统计城市发布信息数量语句
- 麻烦大家看一下,这里是哪里出错了?
- php 下拉框选项中列出所有SELECT数据
2.看php5.3的php.ini配置中,mysql打开了吗
3.mysql_connect前面的@链接去掉,看有什么错误
4.是否mysql版本过低,链接不上,换一个mysql版本
//开启报错级别
error_reporting(E_ALL);
//error_reporting(7);
在页面最顶部加入这个,就知道错误原因了