Już sobie poradziłem!
Daje tu kod do pliku upload.php
<?
for ( $nIndex = 0; $nIndex < count( $thefiles ); $nIndex++ ) {
if ( !empty( $thefiles_name[$nIndex] ) )//czy wybrano plik {
$aType = $thefiles_type[$nIndex];
if ( ( $aType == \"image/gif\" ) ||
( $aType == \"image/pjpeg\" ) ||
( $aType == \"image/jpeg\" ) )
{
if ( $thefiles_size[$nIndex] < ( 1024 * 100 ) )
{
$aNewName = \"../fotki/\" .
$thefiles_name[$nIndex];
copy( $thefiles[$nIndex], $aNewName ); $aNewNames[] = $thefiles_name[$nIndex];
$stan='oki';
} else echo \"Za duży plik !!!\";
} else echo \"Plik nie jest typu gif ani jpeg\"; }
}
?>
Kod do formularza:
Kod
<tr>
<td><p align="right"><b>Top fotka:</b></p></td><td><input type="file" size="111" name="thefiles[]"></td>
</tr>
<tr>
<td><p align="right"><b>Fotka 2:</b></p></td><td><input type="file" size="111" name="thefiles[]"></td>
</tr>
<tr>
<td><p align="right"><b>Fotka 3:</b></p></td><td><input type="file" size="111" name="thefiles[]"></td>
</tr>
Mozna to robić bez konca