PHP-compiled HTTP download code. Download the http resource class with comprehensive functions and obtain the http header information .? PhpclassDedeHttpDown {public $ m_url; public $ m_urlpath; public $ m_schemehttp; the public function allows you to download the http resource class and obtain the http header information.
-
- Class DedeHttpDown
- {
- Public $ m_url = "";
- Public $ m_urlpath = "";
- Public $ m_scheme = "http ";
- Public $ m_host = "";
- Public $ m_port = "80 ";
- Public $ m_user = "";
- Public $ m_pass = "";
- Public $ m_path = "/";
- Public $ m_query = "";
- Public $ m_fp = "";
- Public $ m_error = "";
- Public $ m_httphead = "";
- Public $ m_html = "";
-
- // Initialize the system
- Function PrivateInit ($ url)
- {
- $ Urls = "";
- $ Urls = @ parse_url ($ url );
- $ This-> m_url = $ url;
- If (is_array ($ urls ))
- {
- $ This-> m_host = $ urls ["host"];
- If (! Empty ($ urls ["scheme"]) $ this-> m_scheme = $ urls ["scheme"];
-
- If (! Empty ($ urls ["user"]) {
- $ This-> m_user = $ urls ["user"];
- }
-
- If (! Empty ($ urls ["pass"]) {
- $ This-> m_pass = $ urls ["pass"];
- }
-
- If (! Empty ($ urls ["port"]) {
- $ This-> m_port = $ urls ["port"];
- }
-
- If (! Empty ($ urls ["path"]) $ this-> m_path = $ urls ["path"];
- $ This-> m_urlpath = $ this-> m_path;
-
- If (! Empty ($ urls ["query"])
- {
- $ This-> m_query = $ urls ["query"];
- $ This-> m_urlpath. = "? ". $ This-> m_query;
- }
- }
- }
- // Open the specified URL
- Function OpenUrl ($ url)
- {
- // Reset parameters
- $ This-> m_url = "";
- $ This-> m_urlpath = "";
- $ This-> m_scheme = "http ";
- $ This-> m_host = "";
- $ This-> m_port = "80 ";
- $ This-> m_user = "";
- $ This-> m_pass = "";
- $ This-> m_path = "/";
- $ This-> m_query = "";
- $ This-> m_error = "";
- $ This-> m_httphead = "";
- $ This-> m_html = "";
- $ This-> Close ();
- // Initialize the system
- $ This-> PrivateInit ($ url );
- $ This-> PrivateStartSession ();
- }
- // Obtain the cause of an operation error
- Function printError ()
- {
- Echo "error message:". $ this-> m_error;
- Echo "specific return headers:
";
- Foreach ($ this-> m_httphead as $ k => $ v)
- {
- & Nb
Bytes. ? Php class DedeHttpDown {public $ m_url = ""; public $ m_urlpath = ""; public $ m_scheme = "http"; public...