problemer med upload
jeg har ved at til passe et scripz som jeg har fået af en ven men kan ikke få det til at virke :(men her kommer koden... den sider at der er en fejl i line 40 i trin 3..
trin 2
<center>
<form enctype='multipart/form-data' action='step_3.php' method='post'>
<span class='m'><a href='step_1.php'>Tilbage</a></span>
<table border='0' width='500' cellspacing='0' cellpadding='0' class='ramme'>
<tr>
<td width='100%' valign='top' class='tabel'><span class='m'><b>Trin 2/3</b></span></td>
</tr>
<tr>
<td width='100%' valign='top' align='center'>
<?php
$i = 1;
while ($i <= $_POST[antal]){
echo"
<table border='0' width='100%' cellspacing='2' cellpadding='0'>
<tr>
<td width='100%' align='center'><input name='file[]' type='file' size='50' class='input'> <span class='fontmgrey'><br />Hvor til:</span>
<select name='type'><option selected='selected' value='img/upload/'>Billeder</option><option value='inc/fil/'>Nyttige filer</option><option value='inc/opdate/' >Opdate PDF</option></select>
</td>
</tr>
</table>";
$i = $i+1;
}
?>
</td>
</tr>
<tr>
<td width='100%' valign='top' align='center'><input class='input' type='submit' value='Upload' size='48' class='submit'></td>
</tr>
</table>
</form>
</center>
trin 3
<center>
<?php
if (isset($_FILES['file'])) {
// Folder where files will be uploaded to.
$dist = "inc/fil/";
echo"
<span class='m'><a href='step_1.php'>Tilbage</a></span>
<table border='0' width='500' cellspacing='0' cellpadding='0' class='ramme'>
<tr>
<td width='100%' valign='top' class='tabel'><span class='m'>Trin 3/3</span></td>
</tr>
<tr>
<td width='100%' valign='top'>
<table border='0' width='100%' cellspacing='2' cellpadding='0'>
<tr>
<td width='34%'><span class='m'><b>Navn</b></span></td>
<td width='33%' align='center'><span class='m'><b>Type</b></span></td>
<td width='33%' align='right'><span class='m'><b>Størelse<b></span></td>
</tr>
";
for($i = 0; $i < count($_FILES['file']['name']); $i++) {
if (isset($_FILES['file']['name'][$i]) && $_FILES['file']['name'][$i] !="") {
if(is_uploaded_file($_FILES['file']['tmp_name'][$i])) {
move_uploaded_file($_FILES['file']['tmp_name'][$i], $dist . $_FILES['file']['name'][$i]);
}
else{
echo"Der var en fejl under uploadet";
}
$type = $_FILES['file']['type'][$i];
$name = $_FILES['file']['name'][$i];
$size = $_FILES['file']['size'][$i];
echo "
<tr>
<td width='34%'><span class='m'>$name</span></td>
<td width='33%' align='center'><span class='m'>$type</span></td>
<td width='33%' align='right'><span class='m'>$size</span></td>
</tr>";
}
}
echo"
</table>
</td>
</tr>
</table>
";
}else{
echo "<span class='m'>Systemmet kunne ikke finde en upload. Prøv igen <a href='step_1.php'>ved at klikke her.</a></span>";
}
?>
</center>