Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Co myslicie o takim zabezpieczeniu, przed nadpisaniem pliku
wozniak
post
Post #1





Grupa: Zarejestrowani
Postów: 278
Pomógł: 0
Dołączył: 21.11.2003

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


Jak w temacie o to kod:
  1. <form method=\"post\" enctype=\"multipart/form-data\" action=\"zdjecie.php?x=1\">
  2. <input type=\"file\" name=\"foto\" size=\"20\">
  3. <input type=\"submit\" value=\"Wy&para;lij\" name=\"B1\">
  4. </form>
  5. <?php  
  6.  
  7. if($x == 1 ){
  8.  $nazwa= date(&#092;"y-\");
  9.  $nazwa.= date(&#092;"m\");
  10.  $nazwa.= date(&#092;"d\");
  11. $nazwa1= date(&#092;"H\");
  12. $nazwa1.= date(&#092;"i\");
  13. $nazwa1.= date(&#092;"s\");
  14. if(!file_exists(&#092;"foto/$nazwa$nazwa1$foto_name\")){
  15. copy(&#092;"$foto\", \"foto/$nazwa$nazwa1$foto_name\");
  16.  }
  17.  else{
  18.  print(&#092;"blad\");
  19.  }
  20.  print(&#092;"Zdjecie zostalo dodane
  21.  <img src=&#092;"foto/$nazwa$nazwa1$foto_name\">\");
  22.  }
  23. ?>
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: 19.08.2025 - 19:03