PHP 文件上传脚本


PHP #文件上传 #上传 #文件2012-04-19 21:27

当新手练习用吧,呵呵。

 
 
 
<?php if ( isset( $_FILES['fupload'] ) ) { print "name: ". $_FILES['fupload']['name'] ." "; print "size: ". $_FILES['fupload']['size'] ." bytes "; print "temp name: ".$_FILES['fupload']['tmp_name'] ." "; print "type: ". $_FILES['fupload']['type'] ." "; print "error: ". $_FILES['fupload']['error'] ." "; if ( $_FILES['fupload']['type'] == "image/gif" ) { $source = $_FILES['fupload']['tmp_name']; $target = "upload/".$_FILES['fupload']['name']; move_uploaded_file( $source, $target );// or die ("Couldn't copy"); $size = getImageSize( $target ); $imgstr = "

\'uploaded

"; print $imgstr; } } ?>



相关文章

粤ICP备11097351号-1