<?php
$postArray = array (
'seq' => 'MASSLKIWGTLLALLCILCTLLVQSKEVSWREFMKQHYLSPSREFREYKCDVLMRENEAL
KDKSSHMFIYISWYKIEHICTSDNWMDRFRNAYVWVQNPLKVLKCHQENSKNSYTESRSF
NYIEFHCSMDGYVDSIEDLKMVEPIGN',
'uniprot_id' => '',
'email_address' => '',
'job_desc' => '',
'type' => '1',
'phyre_id' => '',
'nostruc' => '0',
'submit_job' => 'CombFunc search'
);$ch = curl_init();curl_setopt($ch, CURLOPT_URL, 'http://www.sbg.bio.ic.ac.uk/~mwass/combfunc/');
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($ch, CURLOPT_POST, count($postArray)) ;
curl_setopt($ch, CURLOPT_POSTFIELDS, $postArray);
curl_setopt($ch , CURLOPT_RETURNTRANSFER, true); $data = curl_exec($ch);
$last_url = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL);
curl_close($ch);echo $data;
//return the redirection url
echo $last_url;
return $last_url;
?>

解决方案 »

  1.   

    你遇到什么问题了?
    看了下
    // 第三个参数要是布尔类型值
    curl_setopt($ch, CURLOPT_POST, true)) ;
    // 用 http_build_query() 转换为字符串
    curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postArray) );
      

  2.   

    你说的不是关键问题,按你说的修改没效果,我觉得是$postArray里表单的问题,submit键值不对或者post的条件缺少之类的