if(!is_dir('img')){//Create the path if it does not exist
mkdir('img');
}
$upfile=$_FILES ["photo"];
$pinfo=pathinfo($upfile["name"]);
$name=$pinfo['basename'];//File name
$tmp_name=$upfile["tmp_name"];
$file_type=$pinfo['extension'];//Get the file type
$showphpath=$path.$name;
if(in_array($upfile["type"],$phtypes)){
echo "File type Not consistent! ";
exit();
}
if(move_uploaded_file($tmp_name,$path.$name)){
echo "Success! ";
Img($showphpath,100,800,2);
}
echo "";
}
?>
< ;/html>
Copy code
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn