Witam, mając taki kod:
<html>
<?php
$a=$_GET['id'];
if (!$a)
$a=$_POST['id'];
if (!$a)
else
echo \"<form action=\"obr1.php\" method=\"post\" enctype=\"multipart/form-data\"> Plik 1: <input type=\"file\" name=\"thefiles[]\"><br><br>
Plik 2: <input type=\"file\" name=\"thefiles[]\"><br><br>
Plik 3: <input type=\"file\" name=\"thefiles[]\"><br><br>
Plik 4: <input type=\"file\" name=\"thefiles[]\"><br><br>
<input type=\"submit\" name=\"Submit\" value=\"Wyślij\">
<input type=\"hidden\" name=\"id\" value=\"$a\">
</form>\";
include(\"skrypt/sqlj.php\");
$aBasePath = dirname( $PATH_TRANSLATED ); for ( $nIndex = 0; $nIndex < count( $thefiles ); $nIndex++ ) {
if ( !empty( $thefiles_name[$nIndex] ) ) {
$aType = $thefiles_type[$nIndex];
if ( ( $aType == \"image/gif\" ) ||
( $aType == \"image/pjpeg\" ) ||
( $aType == \"image/jpeg\" ) )
{
$aNewName = $aBasePath . \"/foty/$a\" . //daje prefix ID
$thefiles_name[$nIndex];
copy( $thefiles[$nIndex], $aNewName ); $aNewNames[] = $thefiles_name[$nIndex];
$zapytanie = \"INSERT INTO jpegi values (null,'$aNewName',$a)\";
if($wynik) { echo \"rekord dodany\"; }
else
{ echo \"nie dodano\"; } }
}
}
?>
</body>
</html>
Chcę dorobić robienie miniaturek w locie. Oraz pomniejszenie pliku jesli jest większy niż 800x600 jak można to zrobić i z jakich funkcji trzeba skorzystać.