Here's my relevant code:
Code: Select all
<?php include 'config.inc.php'; ?>
<html><head><title>Submit Pictures</title></head>
<body>
<?php
// script stolen from event pic uploader
$details .= "> Processing Images...<br/>";
// get info
$aid = $_POST['aid'];
$date = time();
// get gid associated w/ aid
$sql_gid = "SELECT * FROM photo_album WHERE aid='$aid'";
$result_gid = mysql_query($sql_gid) or die(mysql_error());
$array_gid = mysql_fetch_array($result_gid) or die(mysql_error());
$gid = $array_gid[gid];
// DEBUG
echo print_r($_FILES);
// for every picture slot...
for($i=1; $i<=5; $i++)
{
// check if there was a file uploaded in that picture slot
if ($_FILES['pic']['size']['$i'] > 0)
{
echo "<br/> file $i is in pic slot <br/>";
}
else //this else{} is just here for debug
{
$size_fail = $_FILES['pic']['size']['$i'];
print "<br/> line 61 failure. size = $size_fail <br/>";
}
} // } for loop
?>Code: Select all
Array ( [pic] => Array ( [name] => Array ( [1] => lolcat-funny-picture-moderator1.jpg [2] => lolcat-funny-picture-moderator1.jpg [3] => [4] => [5] => ) [type] => Array ( [1] => image/jpeg [2] => image/jpeg [3] => [4] => [5] => ) [tmp_name] => Array ( [1] => /var/tmp/phpbwL1Os [2] => /var/tmp/phph9HGtq [3] => [4] => [5] => ) [error] => Array ( [1] => 0 [2] => 0 [3] => 4 [4] => 4 [5] => 4 ) [size] => Array ( [1] => 41096 [2] => 41096 [3] => 0 [4] => 0 [5] => 0 ) ) ) 1
line 61 failure. size =
line 61 failure. size =
line 61 failure. size =
line 61 failure. size =
line 61 failure. size =