远程文件有防盗的SESSION验证,对PHP不是很精通,不会修改代吗
请高高手指点!!!<?php 
function create_html($save_path,$file_name,$read_file) 

    //读取文件然后写入到一个文件 
    //$save_path:要保存的路径,UNIX风格,最后加"/"; 
    //$file_name:要保存的文件名 
    //$read_file:读取的文件或者URL 
    /*关于返回值 
    -1:没有创建目录权限 
    -2:没有权限读取文件或者没有此文件或者没有读取到任何内容 
    -3:写入文件错误 
    -4:文件不可写 
    1:执行成功 
    */ 
    $path_array = explode("/",$save_path); 
    foreach ($path_array as $path) 
    { 
        if ($path) 
        { 
            $now_path .= $path."/"; 
            if (!is_dir($now_path)) 
            { 
                if (!mkdir($now_path)) 
                { 
                    //没有创建目录权限,退出。 
                    return -1; 
                    exit();     
                } 
            } 
        } 
    } 
     
    //读取文件 
    $contents = @file_get_contents($read_file); 
    if (!$contents) 
    { 
        //没有权限读取文件或者没有此文件或者没有读取到任何内容 
        return -2; 
        exit(); 
    }else 
    { 
        //写入文件 
        $handle = @fopen($save_path.$file_name,"w+"); 
        if ($handle) 
        { 
            if (@fwrite($handle,$contents)) 
            { 
                return  1; 
            }else 
            { 
                //写入文件错误 
                return -3;     
            } 
        }else 
        { 
            //文件不可写 
            return -4;     
        } 
    } 
     
//END FUNCTION 
} /********************************示例************************/ 
/* 
绝对路径 
echo create_html("e:/af/asdf/","1.html","http://www.sohu.com"); 
echo create_html("e:/af/asdf/","2.html","e:/af/asdf/1.html"); 
相对路径 
echo create_html("./adf/asfd/","3.html","http://www.sina.com.cn"); 
*/ 
/***********************************************************/ 
?>