php新手!为什么浏览器不显示php代码?

quietflower 2013-06-16 10:46:08
浏览器运行以后总是出现空白页,然后查看源文件就发现没有php部分的代码?代码是下载的源码,是不是配置有问题啊?
...全文
646 22 打赏 收藏 转发到动态 举报
写回复
用AI写文章
22 条回复
切换为时间正序
请发表友善的回复…
发表回复
「已注销」 2013-06-16
  • 打赏
  • 举报
回复
那肯定是你if的条件是false,所以没显示啊
quietflower 2013-06-16
  • 打赏
  • 举报
回复
没有错误信息
一起混吧 2013-06-16
  • 打赏
  • 举报
回复
php.ini 中 display_errors=On 重启服务器再运行看有不有错误信息。
quietflower 2013-06-16
  • 打赏
  • 举报
回复
呵呵,改过来了,但是还是不行
「已注销」 2013-06-16
  • 打赏
  • 举报
回复
汗——!以<?php开头,以?>结尾
quietflower 2013-06-16
  • 打赏
  • 举报
回复

改成这样还是不行
「已注销」 2013-06-16
  • 打赏
  • 举报
回复
<?是短标记,需要在php.ini开启short_open_tag才能使用,建议不要使用短标记
quietflower 2013-06-16
  • 打赏
  • 举报
回复
每个都要这样改?
一起混吧 2013-06-16
  • 打赏
  • 举报
回复
将 <? 改为 <?php 再说,之后再看情况。
quietflower 2013-06-16
  • 打赏
  • 举报
回复

这是下的代码,我也不是很清楚,但是不是写了echo吗
「已注销」 2013-06-16
  • 打赏
  • 举报
回复
查看源文件是看不到php代码的,代码是不是没有页面输出,所以出现空白页呢
quietflower 2013-06-16
  • 打赏
  • 举报
回复
之前调用 mysql_connect()函数时, 提示我 undefined function 然后我改了php.ini把mysql.dll和mysqli.dll打开了,还改了其他的配置
quietflower 2013-06-16
  • 打赏
  • 举报
回复
为什么要这样写?显示404 Not Found
xuzuning 2013-06-16
  • 打赏
  • 举报
回复
这个就是 product_info.php 吗?
访问时需要
http://127.0.0.1/webshop/product_info.php?P_ID=nnn
quietflower 2013-06-16
  • 打赏
  • 举报
回复
这只是其中一个php文件
quietflower 2013-06-16
  • 打赏
  • 举报
回复
<html> <head> <meta http-equiv="Content-Type" content="text/html; charsetgb2312" /> <title>商品内容页</title> <link href="images/style.css" rel="Stylesheet" type="text/css" /> </head> <body style="margin:0px 0px 0px 0px; text-align:center"> <table border="1" cellspacing="0" cellpadding="0" style="width:100%"> <tr><td width="250px"> <?php require ('sub_newslist1.php'); require ('sub_newslist2.php'); require ('sub_productlist3.php');?> </td> <td valign="top" width="750px"> <table border="1" cellspacing="0" cellpadding="0" width="100%"> <?php require_once("conn/Conn_DB.php"); //包含数据库链接文件 if($_GET["P_ID"]!="") { $pid = $_GET["P_ID"]; //商品编号 $str = "select * from Product_Info where P_ID =".$pid; //查询语句 $arr = mysql_query( $str); //执行SQL语句 $result = mysql_fetch_array($arr); //获取查询结果 ?> </table> <table border="1" cellspacing="0" cellpadding="0" width="100%"> <tr><td rowspan="4" width="300px"><img src='<?php echo $result["P_Image"];?>' width="250px" height="250px"/> </td> <td width="450px"> <?php echo $result["P_Name"];?> </td></tr> <tr><td> 市场价: <?php echo $result["P_MPrice"];?> 会员价: <?php echo $result["P_VPrice"];?> </td></tr> <tr> <td> <?php echo $result["P_CreateTime"];?> </td></tr> <tr> <td><a class="a1" href="shopcar_info.php?P_ID=<?php echo $result["P_ID"];?>">放入购物车</a></td></tr> <tr><td colspan="2">商品详细介绍</td></tr> <tr><td colspan="2"> <?php echo $result["P_Intro"];?> </td></tr> <tr><td colspan="2"> <a class="a1" href="javascript:history.back(-1);" target="_self">返回</a> </td></tr> <?php } ?> </table> </td></tr></table> </body> </html>
xuzuning 2013-06-16
  • 打赏
  • 举报
回复
贴出你的代码,不要截图
quietflower 2013-06-16
  • 打赏
  • 举报
回复
可以把完整的案例发给你们,帮我看看吗?
quietflower 2013-06-16
  • 打赏
  • 举报
回复
那为什么我下的一个案例不能完整的运行呢?就登录以后就是空白页
xuzuning 2013-06-16
  • 打赏
  • 举报
回复
查看源文件就发现没有php部分的代码 这是正确的,php 代码不会出现在浏览器中!
加载更多回复(2)

21,887

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧