Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP] Nie przekazuje tekstu po wysładniu - submit
Majkelo23
post 30.04.2012, 16:48:31
Post #1





Grupa: Zarejestrowani
Postów: 226
Pomógł: 17
Dołączył: 13.02.2012

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


  1. if ( $user_logged_in && isset($_GET['manage']) && htmlspecialchars($_GET['manage']) == 'files' )
  2. {
  3. if ( !isset($_POST['uploaded']) )
  4. {
  5. $filname = $_POST['filname'];
  6. setcookie('filname', $filname, time() + 15 * 60);
  7. $uchwyt = @fopen($filname, 'r');
  8. $file = file_get_contents($filname);
  9.  
  10. $body = '<form action="lol.php?manage=files" method="post"><textarea name="filees" cols="60" rows="4">'.$file.'</textarea><br><input type="submit" name="uploaded" value="Save"></form>';
  11. echo $body;
  12. }
  13. else if ( isset($_POST['uploaded']) )
  14. {
  15. $filname = $_COOKIE['filname'];
  16. $uchwyt = @fopen($filname, 'r');
  17. echo $_POST['filees'];
  18. if ($uchwyt)
  19. {
  20. while (($data = fgets($uchwyt, 4096)) !== false)
  21. {
  22. $zamien = $_POST['file'];
  23. fputs($uchwyt, $zamien);
  24. }
  25. if (!feof($uchwyt))
  26. {
  27. echo "Błąd: niespodziewany błąd fgets()\n";
  28. }
  29. fclose($uchwyt);
  30. echo "gotowe";
  31. }
  32. }
  33. }


Chodzi o textarea - po wciśnięciu submit'a i wyechowaniu go, nic nie zwraca, nie wiem czemu. Myślałem, że to wina exit; ale po zlikwidowaniu go, dalej jest to samo. Jakaś wskazówka?

Zrobiłem var_dump($_POST['filees'] i zwrócił:

Cytat
string(305) ""


więc tekst jest, ale go nie ma? arrowheadsmiley.png

Ten post edytował Majkelo23 30.04.2012, 16:25:08
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 Wersja Lo-Fi Aktualny czas: 13.06.2025 - 19:00