<html>
<head>
<title>File Upload</title>
</head>
<?php
$f_dir = "/your/dir/";
$f_url = "your.web.site.com";
if ( isset( $fupload ) ) {
print "path: $fupload<br>\n";
print "name: $fupload_name<br>\n";
print "size: $fupload_size<br>\n";
print "type: $fupload_type<br>\n\n";
if ( $fupload_type == "image/gif" ) { // or whatever you want it to be
copy ( $fupload, "$f_dir/$fupload_name") or die ("Failed");
print <img src=\"$f_url/$fupload_name\"><p>\n\n";
}
}
?>
<body>
<form enctype="multipart/form-data" action="<?php print $PHP_SELF; ?>" method="POST">
<input type=hidden name="MAX_FILE_SIZE" value="51200">
<input type=file name="fupload"><br>
<input type=submit value="Upload>>">
</form>
</body>
</html>