The $ _ FILES problem is completely normal code on a computer. after changing the computer, something went wrong. what is the problem? The webpage is garbled and the function cannot be used. & lt; html & gt; & nbsp; & lt; head & gt; & nbsp; & lt; meta & nbsp; http-equiv = "C about $ _ FILES
The code on a computer is completely normal. if something goes wrong after changing the computer, what is the possible problem? Thank you!
The page is garbled and the function cannot be used.
File Upload
Function getname ($ exname ){
$ Dir = "uploadfile /";
$ I = 1;
If (! Is_dir ($ dir )){
Mkdir ($ dir, 0777 );
}
While (true ){
If (! Is_file ($ dir. $ I. ".". $ exname )){
$ Name = $ I. ".". $ exname;
Break;
}
$ I ++;
}
Return $ dir. $ name;
}
$ Exname = strtolower (substr ($ _ FILES ['upfile'] ['name'], (strrpos ($ _ FILES ['upfile'] ['name'], '. ') + 1 )));
$ Uploadfile = getname ($ exname );
If (move_uploaded_file ($ _ FILES ['upfile'] ['tmp _ name'], $ uploadfile )){
Echo "file uploaded successfully! ";
Echo"
";
Echo"
Below are some information about file upload:
Original file name: ". $ _ FILES ['upfile'] ['name'].
"
Type: ". $ _ FILES ['upfile'] ['type'].
"
Temporary File name: ". $ _ FILES ['upfile'] ['tmp _ name'].
"
File size: ". $ _ FILES ['upfile'] ['size'];
}
?>
Script
Share :??