Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> readfile() i bezpieczeństwo
eyedropper
post
Post #1





Grupa: Zarejestrowani
Postów: 9
Pomógł: 0
Dołączył: 30.04.2006

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


Witam (IMG:http://forum.php.pl/style_emoticons/default/snitch.gif)

Mam taki kod php:

  1. <?php
  2. $tfile = $_POST[ 'file'];
  3.  if(is_file($tfile) )
  4.  {
  5. header("Expires: Mon, 10 Jul 1990 00:00:00 GMT");
  6. header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
  7. header("Cache-Control: no-store, no-cache, must-revalidate");
  8. header("Cache-Control: post-check=0, pre-check=0", false);
  9. header("Content-type: image/jpeg ");
  10. header("Pragma: no-cache");
  11. readfile($tfile);
  12. die();
  13.  }
  14. ?>


z flasha wysyłam nazwę pliku a pozniej go odbieram tez we flashu
zreszta co robi ten skrypt widac, po prostu pliki laduja sie tak jaby w przgladarce nie bylo cache
ale w tej formie ten skrypt nie jest niestety zbyt bezpieczny
a dokladniej to:
  1. <?php
  2. $tfile = $_POST[ 'file'];
  3.  if(is_file($tfile) )
  4.  {
  5. readfile($tfile);
  6. die();
  7.  }
  8. ?>


jak sprawic zeby ten kod byl bardziej bezpieczny.
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: 13.10.2025 - 19:23