您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

php使用curl上传文件为什么删掉一句无法执行

2024/5/4 15:16:34发布23次查看
'@'.realpath($path).;filename=.$filename); $ch = curl_init(); curl_setopt($ch, curlopt_url, $url); curl_setopt($ch, curlopt_post, true ); curl_setopt($ch, curlopt_postfields, $data); curl_setopt($ch, curlopt_header, false); curl_setopt($ch, curlopt_returntransfer, true); $return_data = curl_exec($ch); curl_close($ch); $decode = json_decode($return_data); echo $decode->original_pic; } if ($_post) { $url = 'https://127.0.0.1/img.php'; $tmpname = $_files['fname']['name']; $tmpfile = $_files['fname']['tmp_name']; upload_file($url,$tmpname,$tmpfile); exit; } echo ' ';?>

代码如上,为什么删掉就无法执行post?
回复内容: '@'.realpath($path).;filename=.$filename); $ch = curl_init(); curl_setopt($ch, curlopt_url, $url); curl_setopt($ch, curlopt_post, true ); curl_setopt($ch, curlopt_postfields, $data); curl_setopt($ch, curlopt_header, false); curl_setopt($ch, curlopt_returntransfer, true); $return_data = curl_exec($ch); curl_close($ch); $decode = json_decode($return_data); echo $decode->original_pic; } if ($_post) { $url = 'https://127.0.0.1/img.php'; $tmpname = $_files['fname']['name']; $tmpfile = $_files['fname']['tmp_name']; upload_file($url,$tmpname,$tmpfile); exit; } echo ' ';?>

代码如上,为什么删掉就无法执行post?
有没有什么错误信息啊!贴出来看看
。。。应该有报错的啊,执行是空返回吗?那只能打断点看看那一步出问题
上传的文件信息应该是会存在放 $_files 而不会存在放$_post里面 然后你的post里面不就没东西了提前打出$_post
没有找到文档说明 只是试验了下 可以把submit设置一个name
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product