file_array['type'] == "image/gif'
is wrong. Should be:
file_array['type'] == "image/gif"
You better use this code below. I edited all your syntax errors so you wouldnt get any parse errors with this one. (However this only applies to syntax errors, I cant say anything with your coding algorithm.
And may I suggest you begining PHP from the begining with learning the basics first? You are going too fast to write this script if you really dont know how to correct these simple errors. My 2 cents..
-- cut ---
$file_dir= "/path/to/fokder/uploads";
$file_url= "http://www.yoursite.com/uploads";
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";
$filename=(string)$file_array['tmp_name'];
$filetype=(string) $file_array['type'];
if (is_uploaded_file($filename) AND $filetype=="image/gif" )
{
$log_v1=$file_array['tmp_name']; //$log_v2=$file_dir."/".$file_name;
move_uploaded_file($log_v1, $log_v2) or die ("Couldn't copy");
print "<IMG src='\"$file_url/$file_name\"'><P>\n\n"; }
}
-- cut ---
|