PHP Local curl is OK, but it appears on the SAE after object moved to here

Source: Internet
Author: User
login.php
 debug = 0;    $s = new saestorage ();    $domain = ' SDLGDM ';    $filename = '/yzm/';        if ($_post[' login ') {$url = ' http://210.44.176.134/(buoezbuq4apeu0v0151ruv55)/default2.aspx '; $data = ' __viewstate= '. UrlEncode ($_post[' stat '). ' &txtusername= '. UrlEncode ($_post[' TextBox1 '). ' &textbox2= '. UrlEncode ($_post[' TextBox2 '). ' &txtsecretcode= '. UrlEncode ($_post[' TextBox3 '). ' &radiobuttonlist1= '. UrlEncode (' student '). '        &button1=&lblanguage=&hidpdrs=&hidsc= ';         $data = Iconv ("UTF-8", "GBK", $data);       $ch = Curl_init ();            $proxy = "http://127.0.0.1:8087", if ($proxy) {echo ' proxy ';        curl_setopt ($ch, Curlopt_proxy, $proxy);}        curl_setopt ($ch, Curlopt_url, $url);        curl_setopt ($ch, curlopt_header,1);        curl_setopt ($ch, curlopt_returntransfer,1);        curl_setopt ($ch, curlopt_followlocation,true); curl_setopt ($ch, Curlopt_useragent, "mozilla/5.0 (Windows NT 6.1; WOW64) applewebkit/537.36 (khtml, like Gecko) chrome/28.0.158888800.95 safari/537.36 SE 2.X METASR 1.0 ");        curl_setopt ($ch, Curlopt_referer, $url);        curl_setopt ($ch, curlopt_post,1);        curl_setopt ($ch, Curlopt_postfields, $data);  /* curl_setopt ($ch, Curlopt_httpheader,array (' proxy-connection:keep-alive ', ' Cache-control:        Max-age=0 ', ' origin:http://210.44.176.133 ', ' dnt:1 ',)); */echo '
';        $Headers = Curl_getinfo ($ch);p rint_r ($Headers);        $r = curl_exec ($ch);        Curl_close ($ch);        Print_r ($r);//die;        $pre = ' http://210.44.176.134/';        $pat = "/location: (. *)/I";        Preg_match ($pat, $r, $m);        $rurl = Trim ($m [1]);        Print_r ($rurl); $rurl = $pre. "                SUBSTR ($rurl, 1);        Location $r = $man->httpget ($rurl, $url, 0,array (), $proxy);                File_put_contents (' Main.txt ', $r);        $pre = ' http://210.44.176.134/(buoezbuq4apeu0v0151ruv55)/';                $pat = '/';        $infourl = Trim ($m [1]); echo $infourl = $pre. "                    $infourl;        $r = $man->httpget ($infourl, $rurl, 0,array (), $proxy);        File_put_contents (' Info.txt ', $r);    Echo $r;        }else{//login $url = ' http://210.44.176.134/(buoezbuq4apeu0v0151ruv55)/default2.aspx ';        $r = $man->httpget ($url, ", 1,array (), $proxy);        $pat = "/location: (. *)/I";        Preg_match ($pat, $r, $m); $rurl = Trim ($m [1]);        File_put_contents (' Loginpage.txt ', $r); Print_r ($r);d ie;            Print_r ($r);d ie;        GET __viewstate $pat = '/name= ' __viewstate "value=" ([^ "]*") "/I";        Preg_match ($pat, $r, $m);                $stat = $m [1];        GET vocde $vocde _url = ' http://210.44.176.134/(buoezbuq4apeu0v0151ruv55)/checkcode.aspx ';        $r = $man->httpget ($vocde _url, $url, 0,array (), $proxy); $base =base64_encode ($r);? >
  


curlajax.class.php
  debug = 1; $this->ua = ' mozilla/5.0 (Windows NT 6.1;        WOW64) applewebkit/537.36 (khtml, like Gecko) chrome/28.0.158888800.95 safari/537.36 SE 2.X METASR 1.0 ';} /**************************** *get Request Resource * @param string address * @param string Referer * @param boolen return header * @pa Ram Array Header additional cookie ****************************/function HttpGet ($url, $referer = ", $withhead =1, $httphead = Array ()        , $proxy = ') {$ch = Curl_init (); if ($proxy) {curl_setopt ($ch, Curlopt_proxy, $proxy);} curl_setopt ($ch, Curlopt_url, $url), curl_setopt ($ch, Curlopt_cookiejar, $this->cookiejar), curl_setopt ($ch,        Curlopt_cookiefile, $this->cookiefile);        curl_setopt ($ch, Curlopt_header, $withhead);        curl_setopt ($ch, curlopt_returntransfer,1);        curl_setopt ($ch, curlopt_followlocation,true); curl_setopt ($ch, curlopt_autoreferer,1);/*curl_setopt ($ch, Curlopt_httpheader,array (' Proxy-connection:keep-a       Live ', ' cache-control:max-age=0 ',     ' origin:http://210.44.176.133 ', ' dnt:1 ',); */curl_setopt ($ch, curlopt_useragent, $this-&gt        ; UA);        curl_setopt ($ch, Curlopt_referer, $referer);        $r = curl_exec ($ch); if ($this->debug) {echo '
';        Var_dump (Curl_getinfo ($ch));        } curl_close ($ch);    return $r;    /**************************** *post Request Resource * @param string address * @param string Referer * @param array to submit data * @param Boolen returns the head ****************************/function HttpPost ($url, $referer = ", $postdata =array (), $withhea        D=0, $httphead = Array (), $proxy = ") {$ch = Curl_init (), if ($proxy) {curl_setopt ($ch, Curlopt_proxy, $proxy);}        curl_setopt ($ch, Curlopt_url, $url);        curl_setopt ($ch, Curlopt_header, $withhead);        curl_setopt ($ch, curlopt_returntransfer,1);        curl_setopt ($ch, curlopt_followlocation,true);        curl_setopt ($ch, curlopt_autoreferer,1);        curl_setopt ($ch, curlopt_useragent, $this->ua);        curl_setopt ($ch, Curlopt_referer, $referer);        curl_setopt ($ch, curlopt_post,1);        curl_setopt ($ch, Curlopt_postfields, $postdata);        $r = curl_exec ($ch); if ($this->debug) {echo '
';            Var_dump (Curl_getinfo ($ch));        }        Curl_close ($ch);        return $r;    }}


The appropriate information can be obtained locally, and can be placed on the SAE always after the object moved to here,
The value of location in the information printed on the 49th line of login.php on the SAE is
location:/(BUOEZBUQ4APEU0V0151RUV55)/zdy.htm?aspxerrorpath=/xs_main.aspx;
And normal, that is, the local values should be
Location:/(BUOEZBUQ4APEU0V0151RUV55)/xs_main.aspx?xh=1011125007

My brother really knows little about some things in curl. Kneeling for the forum Daniel Help ....
This is the test on my SAE. Address: http://1.sdlgwx.sinaapp.com/lg/login.php Test account: 1011125007 password 111111


Reply to discussion (solution)

Landlord, your problem solved it ... I am the same problem as you are ... Same

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.