Curl不传递数据 [英] Curl doesn't pass data
本文介绍了Curl不传递数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好
我正在做一个卷曲脚本,将数据传递到一个站点并回显结果,但似乎数据也没有发布它'调试日志中没有显示
这里是我的代码
hello
I''m doing a curl script that passes data to a site and echo result but it seems that data isn''t posted also it''s not shown in the debug log
here is my code
<?php
$imei = "imei=11111111111119";
//set POST variables
$url = 'http://xxxx.xx/xxx.php';
//open connection
$ch = curl_init();
//set the url, number of POST vars, POST data
curl_setopt($ch,CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_POST, true);
curl_setopt($ch,CURLOPT_POSTFIELDS, $imei);
curl_setopt ($ch, CURLOPT_REFERER, 'http://www.xxxxx.xx');
curl_setopt($ch, CURLOPT_STDERR, fopen('php://output', 'w+'));
curl_setopt($ch, CURLOPT_VERBOSE, 1);
//execute post
$result = curl_exec($ch);
//close connection
curl_close($ch);
echo $imei;
?>
你能来吗请帮帮我吧?
我做错了什么?
提前致谢
Can you please hel me with this??
what am i doing wrong?
Thanks in advance
推荐答案
imei = imei = 11111111111119;
// 设置POST变量
imei = "imei=11111111111119"; //set POST variables
url = ' http:/ /xxxx.xx/xxx.php'跨度>;
// 打开连接
url = 'http://xxxx.xx/xxx.php'; //open connection
ch = curl_init();
// 设置网址,POST数量,POST数据
curl_setopt(
ch = curl_init(); //set the url, number of POST vars, POST data curl_setopt(
这篇关于Curl不传递数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文