Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 我的一个HTML脚本在IE中不起作用_Php_Batch File - Fatal编程技术网

Php 我的一个HTML脚本在IE中不起作用

Php 我的一个HTML脚本在IE中不起作用,php,batch-file,Php,Batch File,出于某种原因,当我在IE中运行它时,它只显示除嵌入式php代码以外的所有内容, 有人知道我该怎么做吗?这是我的密码: //Server stats display code: // The page must be refreshed to get most recent checks. <b> Server Stats: |Runs every 10 minutes.| <?php check: exec('C:\Users\<name>\Desktop\serv

出于某种原因,当我在IE中运行它时,它只显示除嵌入式php代码以外的所有内容, 有人知道我该怎么做吗?这是我的密码:

//Server stats display code:
// The page must be refreshed to get most recent checks.
<b>
Server Stats: |Runs every 10 minutes.|
<?php
check:
exec('C:\Users\<name>\Desktop\serverstats.bat');
include("C:\Users\<name>\Desktop\serverstats.txt");
sleep(600);
goto check;
?>
</b>
//.bat contents: |Just embed this somewhere in your site and set the directories.|
//@echo off
//ping 192.168.0.11 > C:\Users\<name>\Desktop\serverstats.txt
//服务器统计数据显示代码:
//必须刷新页面才能获取最新的检查。
服务器统计:每10分钟运行一次|
//.bat contents:|只需将其嵌入站点的某个位置并设置目录即可|
//@回音
//ping 192.168.0.11>C:\Users\\Desktop\serverstats.txt

PHP是一种服务器端语言。它没有任何浏览器依赖项。如果您100%确定它在其他浏览器中工作,而不是在IE中,那么问题将在于周围的HTML代码。但是,您提供的代码块没有任何此类依赖于浏览器的HTML

因为您说过“它只显示除嵌入式php代码以外的所有内容”,所以您的服务器必须安装并配置php

您没有看到任何PHP内容,因为您的PHP正在生成一些错误,并且您的PHP设置正在掩盖错误。首先要做的是,通过在PHP代码中添加以下内容来启用错误报告:

 error_reporting(E_ALL);
这会告诉你错误在哪里


检查包含文件的路径。这是一种可能性。

您必须在安装了PHP的web服务器上运行它。IE本身不知道它是什么,所以它把它解释为纯文本。他是PHP和这个网站的新手。Ppl请友好点,而不是在commentsokay中写无用的东西,我的朋友今天把它打了补丁,并说托管那个脚本,然后转到url并执行它,是的,我刚刚学会了php