【问题标题】:Php showing html tags in browserphp在浏览器中显示html标签
【发布时间】:2014-10-13 15:36:46
【问题描述】:

PHP 没有编码 html 标签,而是简单地在浏览器中打印 html 标签。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="http://ogp.me/ns#">
<head>

<title></title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<meta name="apple-mobile-web-app-capable" content="yes" />
<link href="https://sds.com//sdsd/index.php?storename=all&insertedid=100&references=externalsite&fbrefresh=20140820083315" rel="canonical" />
<meta property="fb:app_id" content="34324324324234324">

<meta property="og:site_name" content=""/>
<meta property="og:title" content="" /> 
<meta property="og:description" content="Number of Links: " /> 
<meta property="og:url" content="https://sss.com/ge/index.php?storename=all&insertedid=100&references=externalsite&fbrefresh=2`enter code here`0140820083315">
<meta property="og:type" content="sdsdsdsd:picture" />
<meta property="og:image" content="">

【问题讨论】:

  • 我不明白这个问题。或者,就我一个人吗?编辑:不,不只是我。
  • 我也不是@Fred-ii-你能扩展一下arjun的问题吗
  • PHP 代码未显示在浏览器中。
  • 它是一个包含 HTML 标签的 php 页面。源代码在浏览器中打印,而不是图形视图。
  • @arjunarjun 你是否在 php 中编码你的 HTML 标签

标签: php html tags centos


【解决方案1】:

由于 HTML 对我来说看起来不错,我认为这不是 PHP 问题,而是服务器/浏览器配置的问题 - 浏览器将 HTML 显示为文本而不是解释它。 @Arjun:您使用什么网络服务器? PHP 文件的名称是什么(以 .php 结尾)?你用什么浏览器?

【讨论】:

  • 嗨,我正在使用带有 apache php 5.3 的 centos 机器。我正在 Firefox 最新版本中对此进行测试。
  • 好吧,那我觉得是文件名造成的;如果我在 FireFox 中打开一个名为 *.html 的文件,一切正常,如果我打开一个名为 *.txt 的文件,FireFox 会将 HTML 显示为文本。
猜你喜欢
  • 1970-01-01
  • 2014-01-21
  • 2020-08-02
  • 1970-01-01
  • 1970-01-01
  • 2023-03-20
  • 2020-08-20
  • 1970-01-01
  • 2013-11-05
相关资源
最近更新 更多