Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP]Remote URL - dodanie możliwości pobierania wielu plików.
jar001
post 14.03.2015, 20:28:44
Post #1





Grupa: Zarejestrowani
Postów: 4
Pomógł: 0
Dołączył: 10.03.2015

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


Cześć!
Znalazłem gdzieś skrypt do pobierania plików z innych stron na mój serwer. Wygląda on tak:

  1. <title>Panel pobierania</title>
  2. <center>
  3. <head>
  4. <style>
  5. Tutaj są style...
  6. </style>
  7. </head>
  8. <font size='5'>Panel pobierania</font><br><br>
  9. <? include("juz1.php"); ?> <!-- Wczytanie skryptu logowania -->
  10. <br><br><form method="post">
  11. <input name="url" size="50" class='pole' ></input><br><br><br>
  12. <input name="submit" type="submit" class='wyslij' value='Pobierz!' />
  13. </form>
  14.  
  15.  
  16. <?php
  17.  
  18. // maximum execution time in seconds
  19. set_time_limit (24 * 60 * 60);
  20.  
  21. if (!isset($_POST['submit'])) die();
  22.  
  23. // folder to save downloaded files to. must end with slash
  24. $destination_folder = 'pliki/';
  25.  
  26. $url = $_POST['url'];
  27. $newfname = $destination_folder . basename($url);
  28.  
  29. $file = fopen ($url, "rb");
  30. if ($file) {
  31. $newf = fopen ($newfname, "wb");
  32.  
  33. if ($newf)
  34. while(!feof($file)) {
  35. fwrite($newf, fread($file, 1024 * 8 ), 1024 * 8 );
  36. }
  37. }
  38.  
  39. if ($file) {
  40. fclose($file);
  41. }
  42.  
  43. if ($newf) {
  44. fclose($newf);
  45. }
  46.  
  47. ?>
  48. </center>


I teraz pytanie; jak dodać do tego możliwość wgrywania 5 plików na raz?

f5

f5

f5
Go to the top of the page
+Quote Post
Aqu
post 15.03.2015, 00:12:42
Post #2





Grupa: Zarejestrowani
Postów: 279
Pomógł: 58
Dołączył: 14.07.2012

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


  1. <input name="url[]" size="50" class='pole' ></input><br>
  2. <input name="url[]" size="50" class='pole' ></input><br>
  3. <input name="url[]" size="50" class='pole' ></input><br>
  4. <input name="url[]" size="50" class='pole' ></input><br>
  5. <input name="url[]" size="50" class='pole' ></input><br><br><br>
  6. <input name="submit" type="submit" class='wyslij' value='Pobierz!' />


+
http://php.net/manual/en/control-structures.foreach.php
Go to the top of the page
+Quote Post
jar001
post 15.03.2015, 15:51:27
Post #3





Grupa: Zarejestrowani
Postów: 4
Pomógł: 0
Dołączył: 10.03.2015

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


A możesz dla mnie przerobić ten skrypt bo sam słabo ogarniam PHP oneeyedsmiley02.png

f5
Go to the top of the page
+Quote Post
Pyton_000
post 15.03.2015, 16:03:15
Post #4





Grupa: Zarejestrowani
Postów: 8 068
Pomógł: 1414
Dołączył: 26.10.2005

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


Skoro sam słabo ogarniasz PHP to po co się za to bierzesz?
Albo się naucz albo zapłać.

Jeśli chcesz się nauczyć to http://phpedia.pl/wiki/Jak_uzyska%C4%87_do..._formularzem%3F
Go to the top of the page
+Quote Post
jar001
post 15.03.2015, 17:45:37
Post #5





Grupa: Zarejestrowani
Postów: 4
Pomógł: 0
Dołączył: 10.03.2015

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


Przecież napisałem że skrypt znalazłem w internecie. Biorę się za to bo potrzebuję taki skrypt.

f5
Go to the top of the page
+Quote Post
com
post 15.03.2015, 23:35:08
Post #6





Grupa: Zarejestrowani
Postów: 3 034
Pomógł: 366
Dołączył: 24.05.2012

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


Nie ma nic za darmo smile.gif
Go to the top of the page
+Quote Post

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

 



RSS Wersja Lo-Fi Aktualny czas: 17.06.2025 - 16:23