IIS7上的PHP fopen/fwrite问题
我正在Windows Server 2008 R2上的IIS7上运行PHP5。查看下面的代码,它将通过POST请求参数接收的字符串写入XML文件IIS7上的PHP fopen/fwrite问题,php,iis,iis-7,windows-server-2008,Php,Iis,Iis 7,Windows Server 2008,我正在Windows Server 2008 R2上的IIS7上运行PHP5。查看下面的代码,它将通过POST请求参数接收的字符串写入XML文件 <?php $temp = ""; if($_SERVER['REQUEST_METHOD']=="POST"){ if($_POST["operation"]=="saveLevels"){ $fileHandle = fopen("c:\\inetpub\\wwwroot\\test\\xml\\levels.xml"
<?php
$temp = "";
if($_SERVER['REQUEST_METHOD']=="POST"){
if($_POST["operation"]=="saveLevels"){
$fileHandle = fopen("c:\\inetpub\\wwwroot\\test\\xml\\levels.xml", 'w');
fwrite($fileHandle, stripslashes($_POST["xmlString"]));
fclose($fileHandle);
$temp = "success";
}elseif($_POST["operation"]=="saveRules"){
$fileHandle = fopen("c:\\inetpub\\wwwroot\\test\\xml\\rules.xml", 'w');
fwrite($fileHandle, stripslashes($_POST["xmlString"]));
fclose($fileHandle);
$temp = "success";
}
}
您能否为这两个选项设置var_dump($fileHandle),向我们展示它的功能。我注意到您只是假设文件已打开,而不是检查值(如果为FALSE,则写入将失败)您提到的那些致命错误是什么?我不知道。在事件查看器中,它只是说由于一个致命错误,它必须自动禁用Windows应用程序池服务。