Script for creating the file exchange function (1 ). For work reasons, you need to install a file exchange item on the LAN, or you can create a function block for downloading files. Using php, mysql, and apache, you can install a file exchange on the LAN for working reasons. you can also create a function block for downloading files.
I am using php, mysql, and apache to post the programming process, because some articles on oso for this reference are also a supplement,
I also pay tribute to my predecessors.
Prepare to create an upfile table in your mysql yourdatabase database.
/* Upload a file table
Create table upfile (
Id TINYINT (8) not null AUTO_INCREMENT, // id of the file
Filename VARCHAR (80) not null, // file name
Fileshow VARCHAR (80) not null, // File description
Date DATE not null, // upload date
Uploader VARCHAR (40) not null, // uploaded signature
Type VARCHAR (40) not null, // file type (manually defined)
Primary key (id)
)
*/
// This is the main page of the program, used to display uploaded files.
// Index. php
File Exchange
$ Db = mysql_connect ("$ hostname", "$ user", "$ password") or die ("unable to connect to database"); // connect to the library Mysql_select_db ("yourdatabse", $ db) or die ("unable to open database "); $ SQL = "select * from upfile "; $ Result = mysql_query ($ SQL ); If ($ myrow = mysql_fetch_array ($ result )) { Echo"
\ N ";Echo"
File name |
Upload date |
Uploaded |
File description |
File type |
\ N ";Do{Printf ("
% S |
% S |
% S |
% S |
% S |
\ N ", $ myrow [" filename "], $ myrow [" filename "], $ myrow [" date "], $ myrow [" uploader "], $ myrow ["fileshow"], $ myrow ["type"]);}// List all files for download.While ($ myrow = mysql_fetch_array ($ result ));Echo"
\ N "; } Else { Echo "no file in the file exchange zone Return "; } ?> |
Bytes. Php, mysql, and apache are used to compile the program...