Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [MySQL][PHP]Nie wysyła pola tekstowego do bazy dancyh
Adam1808
post
Post #1





Grupa: Zarejestrowani
Postów: 2
Pomógł: 0
Dołączył: 12.10.2014

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


Witam.
  1. <div id="konto_dialog" title="Zarządzanie kontem">
  2. <form class="form-horizontal" method="post" action="konto.php">
  3. <div class="form-group">
  4. <label for="inputEmail3" class="col-sm-2 control-label">Imię</label>
  5. <div class="col-sm-10">
  6. <input type="email" type="text" class="form-control" id="inputEmail3" name="imie" value=<?php echo $_SESSION["user_name"]; ?>>
  7. </div>
  8. </div>
  9. <div class="form-group">
  10. <label for="inputEmail3" class="col-sm-2 control-label">Nazwisko</label>
  11. <div class="col-sm-10">
  12. <input type="email" type="text"class="form-control" id="inputEmail3" name="nazwisko" value=<?php echo $_SESSION["user_last_name"]; ?>>
  13. </div>
  14. </div>
  15. <div class="form-group">
  16. <input type="submit" class="form-control" id="inputEmail3" value="Zapamiętaj" >
  17. </div>
  18. </form>
  19. </div>

konto.php:
  1. <?php
  2.  
  3. include("../db_login.php");
  4.  
  5. $imie = $_POST["imie"];
  6. $nazwisko = $_POST["nazwisko"];
  7. $id = $_SESSION["user_id"];
  8.  
  9. mysql_query("UPDATE users SET Imie = '$imie', Nazwisko = '$nazwisko' WHERE ID = '$id'");
  10.  
  11. header("Location: index.php");
  12.  
  13.  
  14. ?>


I tutaj pojawia się problem- przycisk 'Zapamiętaj' działa tylko wtedy, gdy pola 'imie' i 'nazwisko' są puste. Po wpisaniu czegokolwiek w te pola przycisk nie reaguje, a w bazie danych nic się nie aktualizuje. Ktoś ma pomysł, jak to naprawić?
Z góry dziękuję smile.gif
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: 21.08.2025 - 05:07