学习PHP,无法在浏览器中显示它 [英] Learning PHP, Can't Get It to Show Up in a Browser

查看:93
本文介绍了学习PHP,无法在浏览器中显示它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在阅读其中一本O''Reilly书籍,了解PHP和MySQL。我在PHP部分,它提供了几个我可以输入的例子,但由于某些原因它不会出现在我的浏览器中。我确保用PHP扩展名保存文件,但它仍然不会出现。我从非常简单的代码开始尝试:

I''m going through one of the O''Reilly books, learning about PHP and MySQL. I''m in the PHP section and it''s giving several examples of what I can type in, but it won''t show up in my browser for some reason. I made sure to save the file with a PHP extension, but it still won''t show up. I started out with very simple code to try it out:

展开 | 选择 | Wrap | 行号

推荐答案

您遇到错误第6行。你应该用分号;来关闭它。


是否有任何类型的错误信息?

如果页面为空白,请执行以下操作:查看源。你看到PHP代码而不是html输出吗?
You have an error on line 6. You should close it with a semicolon ";"

Is there any kind of error message?
If the page is blank do a view source. Do you see php code in there instead of html ouput?


好吧,我做了一个视图源,PHP显示的颜色与HTML不同,所以它知道它'在那里。我尝试在echo
Well, I did a view source, and the PHP is showing up in a different color than the HTML, so it knows it''s there. I tried adding a semicolon to the end of "echo


counter的末尾添加一个分号。它仍然不会出现。


P.S.原谅我,但看起来我忘了把< head>和< / head>我发布的代码中的标签。我编辑并更改了它。
counter" and it still won''t show up.

P.S. Forgive me, but it looks like I forgot to put <head> and </head> tags in my code I posted. I edited and changed it.


这篇关于学习PHP,无法在浏览器中显示它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆