Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/70.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 在使用file_get_contents()函数时收到错误消息,如何使用file_get_contents()函数上载文件?_Php_Mysql_Curl - Fatal编程技术网

Php 在使用file_get_contents()函数时收到错误消息,如何使用file_get_contents()函数上载文件?

Php 在使用file_get_contents()函数时收到错误消息,如何使用file_get_contents()函数上载文件?,php,mysql,curl,Php,Mysql,Curl,我正在尝试将文件从一个域上载到另一个域,我使用了file\u get\u contents()函数 但我不明白问题出在哪里 这是我的密码: Warning: file_get_contents(): failed to open stream: HTTP request failed! HTTP/1.1 406 Not Acceptable in if(isset($fileupload)) { $postdata .= "--".MULTIPART_BOUNDARY."\r\n".

我正在尝试将文件从一个域上载到另一个域,我使用了file\u get\u contents()函数

但我不明白问题出在哪里

这是我的密码:

Warning: file_get_contents(): failed to open stream: HTTP request failed! HTTP/1.1 406 Not Acceptable in 


 if(isset($fileupload))
 {
$postdata .= "--".MULTIPART_BOUNDARY."\r\n".
"Content-Disposition: form-data; name=\"s_id\"\r\n\r\n".
$_SESSION['s_id']."\r\n";
$postdata .= "--".MULTIPART_BOUNDARY."\r\n".
"Content-Disposition: form-data; name=\"s_deadline\"\r\n\r\n".
$_POST['deadline']."\r\n";
$postdata .= "--".MULTIPART_BOUNDARY."\r\n".
"Content-Disposition: form-data; name=\"s_wordcount\"\r\n\r\n".
$_POST['wordcount']."\r\n";
$postdata .= "--".MULTIPART_BOUNDARY."\r\n".
"Content-Disposition: form-data; name=\"s_subject\"\r\n\r\n".
$_POST['subject']."\r\n";
$postdata .= "--".MULTIPART_BOUNDARY."\r\n".
"Content-Disposition: form-data; name=\"s_university\"\r\n\r\n".
$_POST['university']."\r\n";
$postdata .= "--".MULTIPART_BOUNDARY."\r\n".
"Content-Disposition: form-data; name=\"s_notes\"\r\n\r\n".
$_POST['notes']."\r\n";
$postdata .= "--".MULTIPART_BOUNDARY."\r\n".
"Content-Disposition: form-data; name=\"s_submit\"\r\n\r\n".
"submit\r\n";
$postdata .= "--".MULTIPART_BOUNDARY."--\r\n";

$opts = array('http' =>
array(
'method'  => 'POST',
'header'  => 'Content-Type: multipart/form-data; 
 boundary='.MULTIPART_BOUNDARY,
'content' => $postdata
)
);
}
else{
    $postdata = http_build_query(
        array(
            's_id'          =>  $_SESSION['s_id'],
            's_deadline'    =>  $_POST['deadline'],
            's_wordcount'   =>  $_POST['wordcount'],
            's_subject'     =>  $_POST['subject'],
            's_university'  =>  $_POST['university'],
            's_notes'       =>  $_POST['notes'],
            's_submit'      =>  'submit'
        )
    );
    $opts = array('http' =>
                  array(
                      'method'  => 'POST',
                      'header'  => 'Content-type: 
                       application/x-www-form-urlencoded',
                      'content' => $postdata
 )
 );
}

$context  = stream_context_create($opts);
$file_data = file_get_contents($remote_site.'s/create_order_test.php', false, 
$context); 

rsync或ftp会发生什么情况?没有访问权限?没有,当我提交表单时,在提交表单之后,这个脚本被调用