解封權限即可
https://www.google.com/settings/security/lesssecureapps
https://accounts.google.com/DisplayUnlockCaptcha
https://www.google.com/settings/security/lesssecureapps
https://accounts.google.com/DisplayUnlockCaptcha
PHP,MySQL,APACHE,JQUERY,AJAX,UBUNTU
bool imagecopyresampled ( resource
$dst_image
, resource
$src_image
, int
$dst_x
, int
$dst_y
, int
$src_x
, int
$src_y
, int
$dst_w
, int
$dst_h
, int
$src_w
, int
$src_h
)
$dst_image
:新建的图片
$src_image
:需要载入的图片
$dst_x
:设定需要载入的图片在新图中的x坐标
$dst_y
:设定需要载入的图片在新图中的y坐标
$src_x
:设定载入图片要载入的区域x坐标
$src_y
:设定载入图片要载入的区域y坐标
$dst_w
:设定载入的原图的宽度(在此设置缩放)
$dst_h
:设定载入的原图的高度(在此设置缩放)
$src_w
:原图要载入的宽度
$src_h
:原图要载入的高度
ref:http://www.blueshop.com.tw/board/FUM20041006152627A9N/BRD20130417225944UFH/2.html
<?php $browser = new COM("InternetExplorer.Application") or die("can not start internet explorer"); $browser->Visible = true; $browser->Navigate("http://php.a168a.com/andyto202/login.php"); while (($browser->Busy) || ($browser->readystate != 4) ) { com_message_pump(1000); } $browser->Document->passForm->username->INNERTEXT = "abcdef"; $browser->Document->passForm->password->INNERTEXT = "123456"; com_message_pump(2000); //隔兩秒才送出才看得到結果 $browser->Document->passForm->Submit->Click; //在這裡判斷$iecontent;正確進入才存入cookie; while (($browser->Busy) || ($browser->readystate != 4) ) { com_message_pump(2000); } $string = "錯誤"; $iecontent = $browser->Document->body->INNERTEXT; $iecontent = iconv("big5","UTF-8",$iecontent); if (strpos($iecontent,"錯誤")) { //還有很多判斷例如無此帳號....,每個網頁不一樣請自行增加 echo $iecontent; } else { echo "write cookie ok"; $iecookie = $browser->Document->cookie; echo $iecookie; } $browser->Quit(); ?>
/*-----保存COOKIE-----*/ $url = 'domain'; //url地址 $post = "id=user&pwd=123456"; //POST数据 $ch = curl_init($url); //初始化 curl_setopt($ch,CURLOPT_HEADER,1); //将头文件的信息作为数据流输出 curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); //返回获取的输出文本流 curl_setopt($ch,CURLOPT_POSTFIELDS,$post); //发送POST数据 $content = curl_exec($ch); //执行curl并赋值给$content preg_match('/Set-Cookie:(.*);/iU',$content,$str); //正则匹配 $cookie = $str[1]; //获得COOKIE(SESSIONID) curl_close($ch); //关闭curl /*-----使用COOKIE-----*/ curl_setopt($ch,CURLOPT_COOKIE,$cookie);