
php页面显示空白?????急???????
这是person.php页面,用<?phpphpinfo();?>测试能显示php版本信息。怎么就这个不能显示。????????<?phpsession_start();...
这是person.php页面,用<?php phpinfo(); ?>测试能显示php版本信息。怎么就这个不能显示。????????
<?php
session_start();
header('content-type:text/html;charset=gb2312');
include_once '../conn/conn.php';
include_once '../../config.php';
$name= $_SESSION['name'];
if(!empty($name) and !is_null($name)){
$sql = "select * from tb_member where name = '".$_SESSION['name']."'";
$arr = $conne->getRowsArray($sql);
?>
<p/>
<table border="1" cellpadding="0" cellspacing="0" align="center">
<tr>
<td height="25" colspan="6" align="center" valign="middle" style="background-color:#f3fde8;">博客信息(不可修改)</td>
</tr>
<tr>
<td width="100" height="25" align="center" valign="middle">上传文章</td>
<td width="100" align="center" valign="middle"> <?php echo $arr[0]['upfile']; ?> 篇</td>
<td width="75" align="center" valign="middle">上传图片</td>
<td width="125" align="center" valign="middle"> <?php echo $arr[0]['uppics']; ?> 张</td>
</tr>
<tr>
<td width="100" height="25" align="center" valign="middle">点击率</td>
<td width="100" align="center" valign="middle"> <?php echo $arr[0]['hitnum']; ?> 次</td>
<td width="75" align="center" valign="middle">最后登录时间</td>
<td width="125" align="center" valign="middle"> <?php echo $arr[0]['lasttime']; ?></td>
</tr>
</table>
<p/>
<table border="1" cellspacing="0" cellpadding="0" align="center">
<tr>
<td height="25" colspan="5" align="center" valign="middle" style="background-color:#f3fde8;">个人信息(可修改)</td>
</tr>
<tr>
<td width="100" height="25" align="center" valign="middle">id</td>
<td width="100" height="25" align="left" valign="middle"> <?php echo $arr[0]['id']; ?></td>
<td width="100" height="25" align="center" valign="middle">账号</td>
<td width="100" height="25" align="left" valign="middle"> <?php echo $arr[0]['name']; ?></td>
<td width="85" rowspan="4" align="center" valign="middle"> <img src="<?php echo PATH.ROOT.HEADGIF.$arr[0]['headgif']; ?>" border="0" width="60" height="60"></td>
</tr>
<tr>
<td height="25" align="center" valign="middle">性别</td>
<td height="25" align="left" valign="middle"> <?php echo $arr[0]['sex']; ?></td>
<td height="25" align="center" valign="middle">生日</td>
<td height="25" align="left" valign="middle"> <?php echo $arr[0]['birthday']; ?></td>
</tr>
</table>
<?php
}
?> 展开
<?php
session_start();
header('content-type:text/html;charset=gb2312');
include_once '../conn/conn.php';
include_once '../../config.php';
$name= $_SESSION['name'];
if(!empty($name) and !is_null($name)){
$sql = "select * from tb_member where name = '".$_SESSION['name']."'";
$arr = $conne->getRowsArray($sql);
?>
<p/>
<table border="1" cellpadding="0" cellspacing="0" align="center">
<tr>
<td height="25" colspan="6" align="center" valign="middle" style="background-color:#f3fde8;">博客信息(不可修改)</td>
</tr>
<tr>
<td width="100" height="25" align="center" valign="middle">上传文章</td>
<td width="100" align="center" valign="middle"> <?php echo $arr[0]['upfile']; ?> 篇</td>
<td width="75" align="center" valign="middle">上传图片</td>
<td width="125" align="center" valign="middle"> <?php echo $arr[0]['uppics']; ?> 张</td>
</tr>
<tr>
<td width="100" height="25" align="center" valign="middle">点击率</td>
<td width="100" align="center" valign="middle"> <?php echo $arr[0]['hitnum']; ?> 次</td>
<td width="75" align="center" valign="middle">最后登录时间</td>
<td width="125" align="center" valign="middle"> <?php echo $arr[0]['lasttime']; ?></td>
</tr>
</table>
<p/>
<table border="1" cellspacing="0" cellpadding="0" align="center">
<tr>
<td height="25" colspan="5" align="center" valign="middle" style="background-color:#f3fde8;">个人信息(可修改)</td>
</tr>
<tr>
<td width="100" height="25" align="center" valign="middle">id</td>
<td width="100" height="25" align="left" valign="middle"> <?php echo $arr[0]['id']; ?></td>
<td width="100" height="25" align="center" valign="middle">账号</td>
<td width="100" height="25" align="left" valign="middle"> <?php echo $arr[0]['name']; ?></td>
<td width="85" rowspan="4" align="center" valign="middle"> <img src="<?php echo PATH.ROOT.HEADGIF.$arr[0]['headgif']; ?>" border="0" width="60" height="60"></td>
</tr>
<tr>
<td height="25" align="center" valign="middle">性别</td>
<td height="25" align="left" valign="middle"> <?php echo $arr[0]['sex']; ?></td>
<td height="25" align="center" valign="middle">生日</td>
<td height="25" align="left" valign="middle"> <?php echo $arr[0]['birthday']; ?></td>
</tr>
</table>
<?php
}
?> 展开
展开全部
<?php
session_start();
header('content-type:text/html;charset=gb2312');
include_once '../../config.php';
include_once '../conn/conn.php';
if(!empty($_SESSION['name'])){
$sql = "select * from tb_member where name = '{$_SESSION['name']}'";
$arr = $conne->getRowsArray($sql);
?>
<p />
<table border="1" cellpadding="0" cellspacing="0" align="center">
<tr>
<td height="25" colspan="6" align="center" valign="middle" style="background-color:#f3fde8;">博客信息(不可修改)</td>
</tr>
<tr>
<td width="100" height="25" align="center" valign="middle">上传文章</td>
<td width="100" align="center" valign="middle"> <?php echo $arr[0]['upfile']; ?> 篇</td>
<td width="75" align="center" valign="middle">上传图片</td>
<td width="125" align="center" valign="middle"> <?php echo $arr[0]['uppics']; ?> 张</td>
</tr>
<tr>
<td width="100" height="25" align="center" valign="middle">点击率</td>
<td width="100" align="center" valign="middle"> <?php echo $arr[0]['hitnum']; ?> 次</td>
<td width="75" align="center" valign="middle">最后登录时间</td>
<td width="125" align="center" valign="middle"> <?php echo $arr[0]['lasttime']; ?></td>
</tr>
</table>
<p/>
<table border="1" cellspacing="0" cellpadding="0" align="center">
<tr>
<td height="25" colspan="5" align="center" valign="middle" style="background-color:#f3fde8;">个人信息(可修改)</td>
</tr>
<tr>
<td width="100" height="25" align="center" valign="middle">id</td>
<td width="100" height="25" align="left" valign="middle"> <?php echo $arr[0]['id']; ?></td>
<td width="100" height="25" align="center" valign="middle">账号</td>
<td width="100" height="25" align="left" valign="middle"> <?php echo $arr[0]['name']; ?></td>
<td width="85" rowspan="4" align="center" valign="middle"> <img src="<?php echo PATH.ROOT.HEADGIF.$arr[0]['headgif']; ?>" border="0" width="60" height="60"></td>
</tr>
<tr>
<td height="25" align="center" valign="middle">性别</td>
<td height="25" align="left" valign="middle"> <?php echo $arr[0]['sex']; ?></td>
<td height="25" align="center" valign="middle">生日</td>
<td height="25" align="left" valign="middle"> <?php echo $arr[0]['birthday']; ?></td>
</tr>
</table>
<?php
} else {
echo '$_SESSION["name"]的值为空';
}
?>
你试试看,主要的修改就是交换了两个include文件的顺序,如果有问题的话你可以再改回来。最后追加了else的处理。其他的修改都无关紧要。例如empty本身已经涵盖了is_null的判断等,只是优化,不影响结果。
展开全部
从这张页面来看,没有exit();那么这样的问题一般出在
include_once '../conn/conn.php';
include_once '../../config.php';
这两条语句上,试着这样
echo "ccc";exit();
include_once '../conn/conn.php';
echo "aaa";exit();
include_once '../../config.php';
echo "bbb";exit();
保存测试下,如果输出ccc,那么就是include_once '../conn/conn.php';这条语句的问题,看看这个文件中是不是有判断并exit();文件。
include_once '../conn/conn.php';
include_once '../../config.php';
这两条语句上,试着这样
echo "ccc";exit();
include_once '../conn/conn.php';
echo "aaa";exit();
include_once '../../config.php';
echo "bbb";exit();
保存测试下,如果输出ccc,那么就是include_once '../conn/conn.php';这条语句的问题,看看这个文件中是不是有判断并exit();文件。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
你看看是不是把错误信息屏蔽掉了····有可能你这个页面报错··然后你屏蔽掉了··就空白了··
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
error_reporting(E_ALL|E_STRICT);//显示所有错误把这个放在你这个页面最上面,看看网页有错没?
更多追问追答
追问
放上出,就显示error_reporting(E_ALL|E_STRICT);这句话
追答
这个是放在PHP里面,不是放在外面放在<?php这里面
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询