Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP][HTML] Błędnie interpretowany input -=> php
Efan
post
Post #1





Grupa: Zarejestrowani
Postów: 38
Pomógł: 0
Dołączył: 25.01.2007

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


Co jest nie tak z tym skryptem,że przy byle jakiej wartości "usun_fotke" skrypt wykonywany jest cały i usuwa fotkę?

  1. <form action="" method="POST" enctype="multipart/form-data">
  2. <input type="checkbox" name="usun_fotke" value="1">
  3. <input type="submit" value="Zmień" name="upf">
  4. </form>


  1. <?php
  2. if($_POST['upf'])
  3. {
  4.  
  5.  if($_POST['usun_fotke']=="1")
  6.  {
  7.     $up="UPDATE ".$pre."user SET user_fotka='' WHERE user_id='".$_SESSION['user_id']."'";
  8.     mysql_query($up);
  9.     exit();
  10.  }
  11.  else
  12.  {
  13.     include("include/fotka.php");
  14.     $fotu=@imggda($ust);
  15.     $up="UPDATE ".$pre."user SET user_fotka='".$fotu."' WHERE user_id='".$_SESSION['user_id']."'";
  16.     mysql_query($up);
  17.  }
  18.  
  19. }
  20. ?>
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: 18.09.2025 - 19:15