Http download class (for users)

Source: Internet
Author: User
This class is not safe. need to be corrected? Php/*** HttpDownLoad *** @ authorsanshiQQ: 35047205 Email: sanshi0815@tom.comMSN: sanshi0815@tom.com *** @ version1.0.02005/07/10 *** @ deprecated1.h

This class is not safe and needs to be corrected

/**
* HttpDownLoad
*
* @ AuthorSanshi
QQ: 35047205
Email: sanshi0815@tom.com
MSN: sanshi0815@tom.com
*
* @ Version1.0.0 2005/07/10
*
* @ Deprecated
1. http download
 
*/
Class HttpDownLoad
{
Var $ rootDom = 'd:/jsp/'; // sets the download directory.
Var $ openDir; // open the correct path
Var $ open; // directory to be opened
Var $ enter = 3; // Set line feed
Var $ table_w = 800; // you can specify the table width.
Var $ div = array (); // sets the directory to store arrays.
Var $ file = array (); // sets the array for storing files.
Var $ link = array (); // sets the array of connected files.

// Structure function
Function HttpDownLoad ()
{
$ This-> getAll ();
$ This-> head ();
$ This-> printArray ($ this-> dir, 'Directory ');
$ This-> printArray ($ this-> file, 'file ');
$ This-> foot ();
}
// Set the output header
Function head ()
{
Echo'





Table_w. ''align = 'center'> '.' '.' '.' > '.'
 
Www.litou.com
Author: Sanshi
Contact method:Sanshi0815@tom.com
Q: 35047205
';
}
// Set the end.
Function foot ()
{

}
// Obtain the directory to be opened
Function getOpen ()
{
$ Open = $ _ GET ['dir'];
$ This-> open = $ open;
If (! Isset ($ open) | empty ($ open ))
{
$ OpenDir = $ this-> rootDom;
} Else {
$ OpenDir = $ this-> rootDom. $ open .'/';
}
$ This-> openDir = $ openDir;
Return $ openDir;
}

// Split the contents in the directory
Function getAll ()
{
$ OpenDir = $ this-> getOpen ();
$ Handle = opendir ($ openDir );
While ($ allFile = readdir ($ handle ))
{
If (is_dir ($ openDir. $ allFile ))
{
$ This-> dir [] = $ allFile;

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.