Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Miniaturki w locie
kanji
post
Post #1





Grupa: Zarejestrowani
Postów: 124
Pomógł: 1
Dołączył: 27.06.2005
Skąd: Opole

Ostrzeżenie: (0%)
-----


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ć.
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 1)
bela
post
Post #2


Administrator PHPedia.pl


Grupa: Developerzy
Postów: 1 102
Pomógł: 2
Dołączył: 14.09.2003

Ostrzeżenie: (0%)
-----


gd" title="Zobacz w manualu PHP" target="_manual pozatym poszukaj bo było
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 23.08.2025 - 18:49