dongzhang8680 2014-04-16 20:52
浏览 26

将PHP文件导入HTML文档时,如何防止Meta和Title标记注入?

In the tags of my php document, I removed the Title and Meta tags, therefore the header is empty, as such:

<!doctype html>
<html>
<head>
</head>
<body>
<?php
require '/DBConnect.php';
//More code here that generates my output.
?>
</body>
</html>

But when I view the site and inspect element, the resultant injected code includes a Title tag and a meta tag as such:

<meta charset="utf-8">
<title>Untitled Document</title>
//Resultant Code From the import.

Does anyone know how to prevent these tags from injecting? (it doesn't affect the functionality of my document, but it makes it more difficult to read and debug)

** PROBLEM SOLVED

I saw them in the view source as well as the inspect, and I fixed the problem (on accident), since all of my php documents require '/DBConnect.php'; and I had forgotten to clear them in my DBConnect.php file they were transitioning from there into the main HTML through the intermediary PHP file.

Thank you all for the quick feedback! If you hadn't been so quick to answer I might not have noticed that I forgot to put the DBConnect file back into the testing server after editing!

  • 写回答

2条回答 默认 最新

  • dsgw3315 2014-04-16 20:54
    关注

    Just take them out of the include code. They aren't needed. And they really don't belong there anyway.

    评论

报告相同问题?

悬赏问题

  • ¥15 关于大棚监测的pcb板设计
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题