Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP] Na localhost (XAMPP) działa na serwerze nie.
desavil
post
Post #1





Grupa: Zarejestrowani
Postów: 339
Pomógł: 3
Dołączył: 15.10.2008
Skąd: Internet

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


Witam, mam taki skrypt:
  1. <?php
  2. $file_id = $_GET[file_id];
  3. $file = $_GET[file];
  4. $link = "http://xxx:xxx@hotfile.com/dl/$file_id/$file/";
  5.  
  6. $genlink = file_get_contents("http://hotfile.com/dl/$file_id/$file/");
  7. $genlink_zmien = explode('<div class="arrow_down"><strong>Pobieranie:</strong> ', $genlink);
  8. $genlink_zmien2 = explode(' <span>|</span> <strong>', $genlink_zmien[1]);
  9. $genlink_zmien3 = explode(' MB</strong></div>', $genlink_zmien2[1]);
  10. $size = 1024*1024*$genlink_zmien3[0];
  11.  
  12. $nazwa_pliku = $genlink_zmien2[0];
  13. $nazwa_pliku_bezspacji = str_replace(" ","_",$nazwa_pliku);
  14. $file_extension = strtolower(substr(strrchr($nazwa_pliku,"."),1));
  15. switch($file_extension){
  16. case "exe": $ctype="application/octet-stream"; break;
  17. case "zip": $ctype="application/zip"; break;
  18. case "mp3": $ctype="audio/mpeg"; break;
  19. case "mpg": $ctype="video/mpeg"; break;
  20. case "flv": $ctype="video/flv"; break;
  21. default: $ctype="application/force-download";
  22. }
  23.  
  24. $size2=$size-1;
  25. header("Pragma: public"); // required
  26. header("Expires: 0");
  27. header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
  28. header("Cache-Control: private",false);
  29. header("Content-Type: $ctype");
  30. header("Content-Disposition: attachment; filename=$nazwa_pliku_bezspacji");
  31. header("Content-transfer-encoding: binary");
  32. header("Content-Length: $size");
  33. header("Content-Range: bytes $size2/$size");
  34. @readfile($link);
  35. ?>

Na XAMMPie w localhost działa skrypt poprawnie, bez problemów się ściąga pliki, a na serwerze nie. Co jest nie tak?

Wywala taki błąd na serwerze www:
Cytat
Warning: file_get_contents(http://hotfile.com/dl/39878927//) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found in /home/xxxx/domains/domena.pl/public_html/hf.php on line 6

Warning: Cannot modify header information - headers already sent by (output started at /home/xxxx/domains/domena.pl/public_html/hf.php:6) in /home/xxxx/domains/domena.pl/public_html/hf.php on line 25

Warning: Cannot modify header information - headers already sent by (output started at /home/xxxx/domains/domena.pl/public_html/hf.php:6) in /home/xxxx/domains/domena.pl/public_html/hf.php on line 26

Warning: Cannot modify header information - headers already sent by (output started at /home/xxxx/domains/domena.pl/public_html/hf.php:6) in /home/xxxx/domains/domena.pl/public_html/hf.php on line 27

Warning: Cannot modify header information - headers already sent by (output started at /home/xxxx/domains/domena.pl/public_html/hf.php:6) in /home/xxxx/domains/domena.pl/public_html/hf.php on line 28

Warning: Cannot modify header information - headers already sent by (output started at /home/xxxx/domains/domena.pl/public_html/hf.php:6) in /home/xxxx/domains/domena.pl/public_html/hf.php on line 29

Warning: Cannot modify header information - headers already sent by (output started at /home/xxxx/domains/domena.pl/public_html/hf.php:6) in /home/xxxx/domains/domena.pl/public_html/hf.php on line 30

Warning: Cannot modify header information - headers already sent by (output started at /home/xxxx/domains/domena.pl/public_html/hf.php:6) in /home/xxxx/domains/domena.pl/public_html/hf.php on line 31

Warning: Cannot modify header information - headers already sent by (output started at /home/xxxx/domains/domena.pl/public_html/hf.php:6) in /home/xxxx/domains/domena.pl/public_html/hf.php on line 32

Warning: Cannot modify header information - headers already sent by (output started at /home/xxxx/domains/domena.pl/public_html/hf.php:6) in /home/xxxx/domains/domena.pl/public_html/hf.php on line 33


Pozdrawiam i proszę o pomoc.


--------------------
"Nie ma głupich pytań, są tylko głupie odpowiedzi."
Pomogłem?? Kliknij "Pomógł" :) Dzięki!
Go to the top of the page
+Quote Post

Posty w temacie


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 Aktualny czas: 20.08.2025 - 07:35