dougong9987 2011-10-09 22:19
浏览 54
已采纳

卷曲与邮件不工作Php?

well the problem is the simple this today not working !

<?php

function cload($url, $got = array()){

//include(MDL.'socket_adapter.php');
$user_agent = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20100101 Firefox/5.0";

$default_options = array(
    'data'          => 'og',
    'post_data'        => false,
    'referer'        => false,
    'cookie'           => false,
    'auth'             => false,
    'proxy'           => false,
    'pauth'           => false,
    'returndata'      => true,
);

foreach($default_options as $opt=>$value) {
if(!empty($default_options[$opt])) {$got[$opt] = $value;    }
//if(!empty($got[$opt])) {$got[$opt] = $value;      }
}

//echo "<hr>";      print_r($got);      echo "<hr>";

$curl = curl_init();
//if(strstr($referer,"://")){
//curl_setopt ($curl, CURLOPT_REFERER, $got['referer']);}
curl_setopt ($curl, CURLOPT_URL, $url);
curl_setopt ($curl, CURLOPT_USERAGENT, $user_agent);
curl_setopt ($curl, CURLOPT_HEADER, 1);
if(isset($got['returndata'])){
curl_setopt ($curl, CURLOPT_RETURNTRANSFER, 1);
}else{
curl_setopt ($curl, CURLOPT_RETURNTRANSFER, false);
}
curl_setopt ($curl, CURLOPT_ENCODING, 'gzip, deflate');
curl_setopt ($curl, CURLOPT_SSL_VERIFYPEER, false);

    if(isset($got['post_data'])){ curl_setopt($curl ,CURLOPT_POST , true);
    curl_setpot($curl ,CURLOPT_POSTFIELDS ,$got['post_data']); }
    if(isset($got['referer'])) curl_setopt($curl,CURLOPT_REFERER, $got['referer']);
    if(isset($got['cookie'])){ if($got['cookie'] == "0"){
    curl_setopt($curl ,CURLOPT_COOKIEJAR, TBP."cookie.txt"); }//If ever needed...
    else{
    curl_setopt($curl ,CURLOPT_COOKIE, $got['cookie']); }}


    $custom_headers = array();
    $custom_headers[] = "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
    $custom_headers[] = "Pragma: no-cache";
    $custom_headers[] = "Cache-Control: no-cache";
    $custom_headers[] = "Accept-Language: en-us;q=0.7,en;q=0.3";
    $custom_headers[] = "Accept-Charset: utf-8,windows-1251;q=0.7,*;q=0.7";
    if(isset($url_parts['user']) and isset($url_parts['pass'])) {
        $custom_headers[] = "Authorization: Basic ".base64_encode($url_parts['user'].':'.$url_parts['pass']);
    }elseif(isset($got['auth'])){
    $uj = explode(":",$got['auth']); $custom_headers[] = "Authorization: Basic ".base64_encode($uj[0].':'.$uj[1]); }
    if(isset($got['pauth'])){
        curl_setopt($curl ,CURLOPT_PROXYUSERPWD ,$pauth); }
    if(isset($got['proxy'])){
        curl_setopt($curl ,CURLOPT_PROXY ,$proxy); }

    curl_setopt($curl ,CURLOPT_HTTPHEADER, $custom_headers);
    //curl_setopt($curl, CURLINFO_HEADER_OUT, true);

    $response = curl_exec($curl);
    $info = curl_getinfo($curl);// , CURLINFO_HEADER_OUT); 
curl_close ($curl);

//echo "<hr>";  echo $info; echo "<hr>";

   return $response; }

   ?>

now when i am using this code :

<?php
$cv = load('https://localhost/a/ac.php?a=io',array('cookie' => $fbcook,'referer' => $ref,'post_data' => 'odl=lop&isi=837&io'));
echo $cv;
?>

but i am getting error :

Fatal error: Call to undefined function curl_setpot() in C:\xampp\htdocs\a\mack\curl.php on line 41

Please help me ! why this happning this line 42 indicates this line curl_setpot($curl ,CURLOPT_POSTFIELDS ,$got['post_data']); }

thanks

  • 写回答

4条回答 默认 最新

  • doujiao3998 2011-10-09 22:25
    关注

    When a function of cURL is undefined, then it is most likely that cURL is not available.

    However, I think that you meant curl_setopt().

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 做个有关计算的小程序
  • ¥15 MPI读取tif文件无法正常给各进程分配路径
  • ¥15 如何用MATLAB实现以下三个公式(有相互嵌套)
  • ¥30 关于#算法#的问题:运用EViews第九版本进行一系列计量经济学的时间数列数据回归分析预测问题 求各位帮我解答一下
  • ¥15 setInterval 页面闪烁,怎么解决
  • ¥15 如何让企业微信机器人实现消息汇总整合
  • ¥50 关于#ui#的问题:做yolov8的ui界面出现的问题
  • ¥15 如何用Python爬取各高校教师公开的教育和工作经历
  • ¥15 TLE9879QXA40 电机驱动
  • ¥20 对于工程问题的非线性数学模型进行线性化