Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php] Fatal error: call to undefined function..., nie wiem czemu tak jest...
eko_moto
post
Post #1





Grupa: Zarejestrowani
Postów: 14
Pomógł: 0
Dołączył: 8.01.2006
Skąd: z Wawy

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


download.php

  1. <?php
  2. $dl = $_GET['dl'];
  3. $typ = mime_content_type("$dl");
  4. header("Content-type: ".$typ);
  5. header("Content-Disposition: attachment; filename=".$dl);
  6. readfile("$dl");
  7. ?>


To jest kod, wczytany z parametrem (np. download.php?dl=texty/plik.exe) wywołuje błąd:
Fatal error: Call to undefined function mime_content_type() in download.php on line 3

Ten post edytował eko_moto 10.03.2006, 16:35:53
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
mike
post
Post #2





Grupa: Przyjaciele php.pl
Postów: 7 494
Pomógł: 302
Dołączył: 31.03.2004

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


Wydaje mi się że pozostały Ci dwie rzeczy:
1. Upewnić się, że ta funkcja naprawde nie istnieje, function_exists();
2. Skontaktować się z administratorem, być może jest wyłączona z jakichś powodów. Ale to byłoby dziwne.

Jest jeszcze alternatywa:
  1. <?php
  2.  
  3. if( ! function_exists ( 'mime_content_type ' ) )
  4. {
  5. function mime_content_type ( $f )
  6. {
  7. return system ( trim( 'file -bi ' . escapeshellarg ( $f ) ) ) ;
  8. }
  9. }
  10.  
  11. ?>
ale bazuje na przeważnie wyłączanej funkcji system()
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: 2.10.2025 - 19:56