<? Php
/**
* @ Abstract Curl simulate Login
* @ Version Apache/2.2.17 (Win32) mod_ssl/2.2.17 OpenSSL/0.9.8o PHP/5.3.4 mod_perl/2.0.4 Perl/v5.10.1
MySQL client version: mysqlnd 5.0.7-dev-091210-$ Revision: 304625 $
* Time 2012-04-17
* @ Author Veric
* @ Copyright
*/
Function getCookieUrl ($ host_url, $ script_name, $ method = 'get', $ data = '', $ cookie_str = ''){
$ Sock = fsockopen ($ host_url, 80, $ errno, $ errstr, 30 );
If (! $ Sock) die ("$ errstr ($ errno) \ n ");
// Convert the string to uppercase strToUpper
$ Method = strToUpper ($ method );
$ Method = ($ method = 'get ')? 'Get': 'post ';
If (substr ($ script_name, 0, 1 )! = '/'){
$ Script_name = '/'. $ script_name;
}
// Write a file
Fwrite ($ sock, $ method. "". $ script_name. "HTTP/1.0 \ r \ n ");
Fwrite ($ sock, "Host:". $ host_url. "\ r \ n ");
If (! Emptyempty ($ cookie_str )){
Fwrite ($ sock, "COOKIE:". $ cookie_str. "\ r \ n ");
}
Fwrite ($ sock, "Content-type: application/x-www-form-urlencoded \ r \ n ");
If (! Emptyempty ($ data )){
Fwrite ($ sock, "Content-length:". strlen ($ data). "\ r \ n ");
}
Fwrite ($ sock, "Accept: */* \ r \ n ");
Fwrite ($ sock, "\ r \ n ");
If (! Emptyempty ($ data )){
Fwrite ($ sock, "$ data \ r \ n ");
}
Fwrite ($ sock, "\ r \ n ");
// Test whether the file pointer reaches the end of the file.
// Read a row of fgets from the object pointer
$ Body = "";
While (! Feof ($ sock )){
$ Body. = fgets ($ sock, 4096 );
}
Fclose ($ sock );
Return $ body;
}
$ _ SESSION [num] = $ num = 616343;
$ Host_url = 'www. *******. com ';
$ Host_page = 'space. php? Uid = '. $ num.' & ticket = ';
$ Data = '';
// Get $ cookie is an analysis packet captured by the network sniffer. You can download it by yourself.
$ Cookie = 'hyr _ recommenduser = 24; hyr_viewuids = Alibaba; _ utmc = 169110968; hyr_auth = Alibaba % 2F % Alibaba; hyr_loginuser = kongbo; hyr_xy = 0; _ utma = bytes; _ utmb = 169110968.1.10.1331304385; _ utmz = bytes = (direct) | utmccn = (direct) | utmcmd = (none); hyr_sendmail = 1; hyr_synfriend = 1; _ jkb_9202 = 1; _ webim = % 7B % 22o % 22% 3 Afalse % 2C % 22 s % 22% 3A % 22 available % 22% 7D
';
Echo $ content1 = getCookieUrl ($ host_url, $ host_page, 'post', $ data, $ cookie );
?>
From the topic of Vericlongmore