& Lt ;? Php/*** @ abstractCurl simulated login * @ versionApache/2.2.17 (Win32) mod_ssl/2.2.17OpenSSL/0.9.8oPHP/5.3.4mod _ perl/2.0.4Perl/v5.10.1MySQL client version: mysqlnd5.0.7-d /**
* @ 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-
* @ 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
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.