我写的代码跟您的一样 在浏览器打开的时候为什么是乱码呢
问题描述
<!DOCTYPE html><html><head><meta charset="UTF-8"><title>管理员信息管理</title></head><body><?php include("guanli.php");?><h3>管理员信息显示</h3><table width="350" border="1" cellspacing="0"><tr><th>id</th><th>姓名</th><th>账号</th><th>密码</th><th>操作</th> </tr><?phpheader("content-type:text/html:charset=utf8");$conn=mysqli_connect("localhost","root","root","admin");mysqli_set_charset($conn,"utf8");$sql_select="select * from user";foreach ($conn->query($sql_select) as $row){echo "<tr>";echo "<th>{$row['id']}</th>";echo "<th>{$row['name']}</th>";echo "<th>{$row['acount']}</th>";echo "<th>{$row['password']}</th>";echo "<th>{$row['createtime']}</th>";echo "<td><a href='edit.php'>修改</a><a href='del.php'>删除</a><a href='poss.php'>重置密码</a></td>"; echo "</tr>";}?></table></body></html>
问题解答
回答1:这里面有 PHP 代码 ,需要放到 apache 环境当中,才能编译
回答2:php文件能直接在浏览打开?
回答3:应该是没调用带php文件相关文章:
1. docker gitlab 如何git clone?2. 关docker hub上有些镜像的tag被标记““This image has vulnerabilities””3. docker - 各位电脑上有多少个容器啊?容器一多,自己都搞混了,咋办呢?4. golang - 用IDE看docker源码时的小问题5. vim - docker中新的ubuntu12.04镜像,运行vi提示,找不到命名.6. 数据库 - mysql中怎样修改带点的字段名的位置?7. docker镜像push报错8. docker images显示的镜像过多,狗眼被亮瞎了,怎么办?9. dockerfile - [docker build image失败- npm install]10. docker不显示端口映射呢?

网公网安备