【发布时间】:2016-05-05 12:39:12
【问题描述】:
我的index中有以下代码
<html>
<head>
<title>DZ Prototype</title>
<link rel="icon" type="img/ico" href="images/favicon.jpg">
</head>
<body>
<center>
<h1>Welcome to DZ Prototype Testing Area!!</h1>
</center>
<p></p>
<p></p>
<p></p>
<p style="text-align:center"><img src="http://images1.knowable.com/live/articles/2_1ec282dc7578c9356aef339b8b98bbe9.gif" alt="It works!!"></p>
<p></p>
<p></p>
<div align="center">
<?php
$theFile = "cowrie.txt";
$line = file($theFile);
echo $line[18];
if (trim($line[18]) == "Incorrectly Classified Instances 1 100 %") {
echo "<h2><font color=red>Possible Malicious Login Attempt</h2>";
} else {
echo "<h2><font color=green>Status Green</h2>";
}
?>
</div>
</body>
</html>
看来肯定有一个字符混合了整个 php 语法,但不确定是哪一个。
cowrie.txt 仍然需要上传,所以现在 php 中的任何内容都不需要显示,因为没有文件。
【问题讨论】:
-
PHP 出现在 HTML 中。你的主机支持 PHP 吗?
-
那么如果没有文件怎么回显 $line[18] 呢?
-
看起来 PHP 在那里不可用
-
@aynber 刚刚检查,显示支持 php 的页面需要在最后重命名为 .php
-
在比较之前你必须修剪