i just have some problems with displaying a picture when i upload...i can display it but it displays in the default file ... i want to display that picture in a different file so that i can move it around...also it only seems to be displaying the last image i select i would like to choose which picture to show ....
if u want the code ill give it to u
PHP Upload
Moderator: General Moderators
Code: Select all
<html>
<head>
<title>Listing file upload script</title>
</head>
<?php
$file_dir = "../cgi-bin/";
$file_url = "http://bruski.recongamer.com/cgi-bin/";
foreach( $HTTP_POST_FILES as $file_name => $file_array ) {
print "path: ".$file_arrayї'tmp_name']."<br>\n";
print "name: ".$file_arrayї'name']."<br>\n";
print "type: ".$file_arrayї'type']."<br>\n";
print "size: ".$file_arrayї'size']."<br>\n";
if ( is_uploaded_file( $file_arrayї'tmp_name'] )
&& $file_arrayї'type'] == "image/gif" ) {
move_uploaded_file( $file_arrayї'tmp_name'], "$file_dir/$file_name")
or die ("Couldn't copy");
}
}
?>
<body>
<form enctype="multipart/form-data" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="51200">
<input type="file" name="fupload"><br>
<input type="submit" value="Send file!">
</form>
</body>
</html>
<?php
print "<img src="$file_url/$file_name"><p>\n\n";?>