Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [PHP]Miniaturki w locie
Forum PHP.pl > Forum > Przedszkole
kanji
Witam, mając taki kod:
  1. <html>
  2. <?php
  3.  $a=$_GET['id'];
  4.  if (!$a)
  5. $a=$_POST['id'];
  6.  if (!$a)
  7. echo &#092;"nie ma id\";
  8. else
  9. echo &#092;"$a\";
  10.  echo &#092;"<form action=\"obr1.php\" method=\"post\" enctype=\"multipart/form-data\">
  11. Plik 1: <input type=&#092;"file\" name=\"thefiles[]\"><br><br>
  12. Plik 2: <input type=&#092;"file\" name=\"thefiles[]\"><br><br>
  13. Plik 3: <input type=&#092;"file\" name=\"thefiles[]\"><br><br>
  14. Plik 4: <input type=&#092;"file\" name=\"thefiles[]\"><br><br>
  15. <input type=&#092;"submit\" name=\"Submit\" value=\"Wyślij\">
  16. <input type=&#092;"hidden\" name=\"id\" value=\"$a\">
  17. </form>&#092;";
  18.  include(&#092;"skrypt/sqlj.php\");
  19. $aBasePath = dirname( $PATH_TRANSLATED );
  20. for ( $nIndex = 0; $nIndex < count( $thefiles ); $nIndex++ )
  21. {
  22. if ( !empty( $thefiles_name[$nIndex] ) )
  23. {
  24. $aType = $thefiles_type[$nIndex];
  25. if ( ( $aType == &#092;"image/gif\" ) ||
  26. ( $aType == &#092;"image/pjpeg\" ) ||
  27. ( $aType == &#092;"image/jpeg\" ) )
  28. {
  29. $aNewName = $aBasePath . &#092;"/foty/$a\" . //daje prefix ID
  30. $thefiles_name[$nIndex];
  31. copy( $thefiles[$nIndex], $aNewName );
  32. $aNewNames[] = $thefiles_name[$nIndex];
  33. $zapytanie = &#092;"INSERT INTO jpegi values (null,'$aNewName',$a)\";
  34. echo $zapytanie;
  35. $wynik = mysql_query($zapytanie) or die(mysql_error());
  36. if($wynik) { echo &#092;"rekord dodany\";
  37.  }
  38.  else
  39.  { echo &#092;"nie dodano\"; }
  40. }
  41. }
  42. }
  43. ?>
  44.  
  45. </body>
  46. </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ć.
bela
gd" title="Zobacz w manualu PHP" target="_manual pozatym poszukaj bo było
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.