我正在尝试使用 PHP Curl 自动注册https://www3.gotomeeting.com/register/432624022。
根据人们所做的更正,这就是我正在使用的:
<?
$array=array(
'Name_First'=>'Steve',
'Name_Last'=>'Jobs',
'Email'=>'steve@jobs.com',
'Template'=>'island/webinar/registration.tmpl',
'Form'=>'webinarRegistrationForm',
'WebinarKey'=>'432624022',
'ViewArchivedWebinar'=>'false',
'registrant'=>'',
'RegistrantTimeZoneKey'=>'55',
);
function dump($logArray) {
echo '<pre>';
print_r($logArray);
echo '</pre>';
}
function go2webinar($array){
$url='https://www3.gotomeeting.com/en_US/island/webinar/registration.flow';
$url1='https://www3.gotomeeting.com/register/432624022';
$cookie='/therightpath/cookie';
$query=http_build_query($array);
$c=curl_init();
curl_setopt($c,CURLOPT_USERAGENT,'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0.1) Gecko/20100101 Firefox/9.0.1');
curl_setopt($c,CURLOPT_URL,$url);
curl_setopt($c, CURLOPT_FOLLOWLOCATION,1);
curl_setopt($c,CURLOPT_POST,count($array));
curl_setopt($c,CURLOPT_POSTFIELDS,$query);
curl_setopt($c,CURLOPT_RETURNTRANSFER,1);
curl_setopt($c, CURLOPT_SSL_VERIFYPEER,false);
curl_setopt($c, CURLOPT_SSL_VERIFYHOST,0);
curl_setopt($c, CURLOPT_COOKIEFILE,$cookie);
curl_setopt($c, CURLOPT_COOKIEJAR,$cookie);
curl_setopt($c, CURLOPT_REFERER,$url1);
$r=curl_exec($c);//result
dump(curl_getinfo($c));
if(curl_errno($c)) return curl_error($c);
else{
curl_close($c);
return trim($r);
}
}
//GotoMeeting
echo go2webinar($array);
cookie 正在按应有的方式保存:
# Netscape HTTP Cookie File
# http://curl.haxx.se/rfc/cookie_spec.html
# This file was generated by libcurl! Edit at your own risk.
.gotomeeting.com TRUE / TRUE 1371763493 g2mVisitor FirstVisit%3D1340218507523%26LastVisit%3D1340227493492%26RSN%3DDEFAULT
www3.gotomeeting.com FALSE / TRUE 0 g2mSession SessionInfo%3D200000000139397572%253A2B00BFBA6275B45
www3.gotomeeting.com FALSE / FALSE 0 JSESSIONID abc6tY1HKr4Hh9l-3plGt
但是,我现在收到“网络研讨会不可用”页面......