English 中文(简体)
限制不使用博士学位。
原标题:Curl with Post not working 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;
?>

但正出现错误:

致命错误: 呼吁在C:xampphtdocsamackcurl.php第41行文中确定功能曲线。

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

thanks

最佳回答

如果《欧洲刑法》的职能没有界定,则最有可能不存在《欧洲刑法》。

不过,我认为,你指的是<代码>curl_setopt()。

问题回答

简单打字器: 曲线-采样器应当治愈

curl_setpot should be curl_setopt.

您使用Xampp,因此,您需要采取下列步骤,以启动曲折平衡:

  1. Locate XAMPP install directory
  2. Open php/php.ini (probably C:xamppphpphp.ini or C:program filesapachefriendsxamppphpphp.ini)
  3. Do a search for the word ‘curl’ and uncomment (remove the leading semicolon) that line. Before removing: ;extension=php_curl.dll. After removing: extension=php_curl.dll
  4. Save and close
  5. Open apache/bin/php.ini (probably C:xamppapachephp.ini or C: program filesapachefriendsxamppapachephp.ini)
  6. Search for curl, uncomment as before (step 3)
  7. Save and close
  8. Do not forget to restart Apache

Good luck





相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签