Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Download przez header i google analitycs
m4c
post
Post #1





Grupa: Zarejestrowani
Postów: 7
Pomógł: 0
Dołączył: 9.02.2007

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


Witam, udostepnilem do pobrania pliki, poprzez header:

  1. <?php
  2. $filename = "jakis_plik.pdf";
  3.  
  4. header("Pragma: public");
  5. header("Expires: 0"); // set expiration time
  6. header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
  7.  
  8. header("Content-Type: application/force-download");
  9. header("Content-type: application/pdf");
  10. header("Content-Type: application/octet-stream");
  11. header("Content-Type: application/download");
  12. header("Content-Disposition: attachment; filename=".basename($filename).";");
  13.  
  14. header("Content-Transfer-Encoding: binary");
  15. header("Content-Length: ".filesize($filename));
  16.  
  17. @readfile($filename);
  18. exit(0);
  19. ?>


Chcialbym w tym pliku, umiescic kod Google Analitysc. Probowalem tak:

<html>

{kod google}

<?
{kod headera}
?>

</html>

...i nic, widac krzaki zamiast pdfa.

Probowalem tez wstawic kod googla w echo - tez nic z tego.

Co robic??

Ten post edytował m4c 25.02.2009, 09:52:59
Go to the top of the page
+Quote Post

Posty w temacie


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: 22.08.2025 - 17:52