Hi:
I made a form which allow user to upload pictures:
<table width="75%" border="0">
<tr>
<td colspan="2"><b>Home Page Content</b></td>
</tr><form name="content" method=post action="insertcontent.php">
<tr>
<td width="46%">Church Photo</td>
<td width="54%">
<input type="file" name="churchP" value="<? echo $churchP; ?>" >
</td>
</tr>
<tr>
<td width="46%">Church text</td>
<td width="54%">
<textarea name="churchT" value="12345"></textarea>
</td>
</tr>
<tr>
<td width="46%">Reception Hall photo</td>
<td width="54%">
<input type="file" name="recepP">
</td>
</tr>
.....
Below is the page get the post variables:
foreach($HTTP_POST_FILES as $file_array){
print "name: ".$file_array['name']."<br>\n";
print "type: ".$file_array['type']."<br>\n";
print "size: ".$file_array['size']."<br>\n";
print"temp:".$file_array['tmp_name']."<br>\n";
if ( is_uploaded_file( $file_array['tmp_name'] )
&& $file_array['type'] == "image/gif" ) {
move_uploaded_file( $file_array['tmp_name'], "$file_dir/$name")
or die ("Couldn't copy");}
red Below is the page get the post variables
The problem is :it dosen't print the file name ,type, size, and tem_name,Hmm, I am thinking it must be something wrong with this array, or the $HTTP_POST_FILES dosen't work. What do you think?